Re: Using fcntl and |= - "Argument .... isn't numeric in bitwise or ..."
- From: Big and Blue <No_4@xxxxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 21:40:54 +0100
Jim Cochrane wrote:
I'm stumped - trying to get rid of a warning message with code based on
this example snippet from the "Perl Cookbook" book:
Your problem has nothing at all to do with fcntl
"use strict" and "use warnings" would have shown you the problem.
$lags = "";
fcntl(HANDLE, F_GETFL, $flags) or die "Couldn't get flags: $!\n";
$flags |= O_NONBLOCK;
It's $flags which is undefined. You've set $lags, not $flags (and setting it to 0 rather than "" would make far more sense).
You don't have to check for "defined" on the return from
"fcntl".
You aren't even checking the return result from fcntl. You are just ignoring it completely (you're calling it in a void context, i.e. not assigning the return value to anything).
--
Just because I've written it doesn't mean that
either you or I have to believe it.
.
- References:
- Using fcntl and |= - "Argument .... isn't numeric in bitwise or ..."
- From: Jim Cochrane
- Using fcntl and |= - "Argument .... isn't numeric in bitwise or ..."
- Prev by Date: FAQ 4.52 How do I sort an array by (anything)?
- Previous by thread: Re: Using fcntl and |= - "Argument .... isn't numeric in bitwise or ..."
- Next by thread: Get unlimited visitors to your website
- Index(es):
Relevant Pages
|