in reply to Re: Win32 bad file descriptor
in thread Win32 bad file descriptor
I don't think that's the problem. Using parenthesis is perfectly OK. You have to watch out when you leave them out:
The point here is operator precedence. In the wrong example the || binds tighter than 'close'. That's why the low precedence logical operators (and, or, not, xor) were introduced.close MAIL || die "couldn't close: $!"; # oops! close MAIL or die "couldn't close: $!"; # correct close(MAIL) || die "couldn't close: $!"; # correct (original post) close(MAIL) or die "couldn't close: $!"; # correct as well
-- Hofmator
|
---|
In Section
Seekers of Perl Wisdom