Harlan Harris <harlan@cs.wisc.edu> wrote:
> >Therefore, for L<ndbm(3)>, L<sdbm(NA)> and L<DB(3)> you need
> >to C<use Fcntl>, and supply constants for the I<flags> such as
> >C<O_RDWR+O_CREAT> or C<O_RDONLY>.
>
> Trying...
>
> Worked! (Needed "|" rather than "+" for the 4th arg, though.)
Ouch! you're right.
I've not seen this hefalump trap before - another nail in the coffin of
the pseudo-constants exported from modules.
Is this some subtle mis-feature of parsing, or an old-fashioned bug?
(Sorry, once again, that my 5.002b1 is inaccessible to me...)
use Fcntl;
printf "%d %d\n", O_RDWR|O_CREAT, O_RDWR+O_CREAT;
prints
66 2
Using &O_RDWR+&O_CREAT, or O_CREAT()+O_RDWR(), gets the right answer.
Ian
> >Therefore, for L<ndbm(3)>, L<sdbm(NA)> and L<DB(3)> you need
> >to C<use Fcntl>, and supply constants for the I<flags> such as
> >C<O_RDWR+O_CREAT> or C<O_RDONLY>.
>
> Trying...
>
> Worked! (Needed "|" rather than "+" for the 4th arg, though.)
Ouch! you're right.
I've not seen this hefalump trap before - another nail in the coffin of
the pseudo-constants exported from modules.
Is this some subtle mis-feature of parsing, or an old-fashioned bug?
(Sorry, once again, that my 5.002b1 is inaccessible to me...)
use Fcntl;
printf "%d %d\n", O_RDWR|O_CREAT, O_RDWR+O_CREAT;
prints
66 2
Using &O_RDWR+&O_CREAT, or O_CREAT()+O_RDWR(), gets the right answer.
Ian