in reply to Re^2: Could not create socket: Bad file number
in thread Could not create socket: Bad file number

Well, if it does, I can't find any mention of that behaviour in the documentation. The only thing that I can find that even mentions $! is IO::Handle's blocking() method.

update: however, reading the source code shows that you're right. But I can't really say if it will always produce a useful error in $! though. Sometimes it sets $! to $EINVAL, other times it just passes on $! from functions that may or may not set $! on failure. (And some build in functions that do set $! are not documented as such in the perldocs, but that's another story)

  • Comment on Re^3: Could not create socket: Bad file number