Re: Using fcntl and |= - "Argument .... isn't numeric in bitwise or ..."




Quoth Jim Cochrane <allergic-to-spam@xxxxxxxxxxxxxxxxxxx>:

I'm stumped - trying to get rid of a warning message with code based on
this example snippet from the "Perl Cookbook" book:

use Fcntl;

$lags = "";
fcntl(HANDLE, F_GETFL, $flags) or die "Couldn't get flags: $!\n";

You need to read you systems fcntl(2) as well as the perldocs; at least
on mine, it says

F_GETFL Get descriptor status flags, as described below (arg is
ignored).

So, contrary to the example in perldoc -f fcntl, you need

my $flags = fcntl(HANDLE, F_GETFL);

Ben

.



Relevant Pages