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.