Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Win32 bad file descriptor

by OzzyOsbourne (Chaplain)
on Jul 05, 2001 at 19:35 UTC ( #94130=note: print w/replies, xml ) Need Help??

in reply to Win32 bad file descriptor

I never use parenthesis on my close statements. I would use close MAIL. I don't know if that helps, but it's all I really noticed.


Replies are listed 'Best First'.
Re: Re: Win32 bad file descriptor
by Hofmator (Curate) on Jul 05, 2001 at 20:02 UTC

    I don't think that's the problem. Using parenthesis is perfectly OK. You have to watch out when you leave them out:

    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
    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.

    -- Hofmator

Re: Re: Win32 bad file descriptor
by Dalin (Sexton) on Jul 05, 2001 at 19:45 UTC
    I tried that as well. At first I didn't have the parenthesis and added them, but no luck. Bradley
    Where ever there is confusion to be had... I'll be there.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://94130]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2023-10-04 19:59 GMT
Find Nodes?
    Voting Booth?

    No recent polls found