Ken Gillett ha scritto:
Information about these has proved hard to come by, but having ascertained what I need to use I find another problem. I want to calculate the flags to use beforehand, but if I try

    tie %$dbm, "DB_File", $dbf, $dbflags, $mode, $DB_HASH;

even though $dbflags contains O_RDONLY I get the following error:=

Argument "O_RDONLY" isn't numeric in subroutine entry at /usr/lib/perl5/5.8.6/i686-linux/DB_File.pm

You are passing the string "O_RDONLY" to the subroutine, no the value of O_RDONLY.


Maybe this works (untested):

<code>
$dbflags = O_RDONLY;
tie %$dbm, "DB_File", $dbf, $dbflags, $mode, $DB_HASH;
</code>

Marcello


This is caused by using the variable for the flags and if I replace that with the actual string (no quotes) it works fine, so it's happy with $dbf and $mode.


I'm using 5.8.6, but the problem also exists with 5.8.5 at least.

Can anyone suggest how I can get around this and use a variable for the flags?



Ken  G i l l e t t

_/_/_/_/_/_/_/_/_/




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to