in reply to IO::Socket *always* making connection?

IO::Socket does not indicate a failure by thowing an exception is does so by returning false.

In general most Perl modules/function indicate what you could consider soft falures (file does not exist, port in use, anything from outside of Perl) by returning a special return value rather than throwing an exception.

Exceptions are mostly only thrown when the arguments passed in are invalid.

These rules are not hard and fast - module authors can choose differently.

  • Comment on Re: IO::Socket *always* making connection?

Replies are listed 'Best First'.
Re^2: IO::Socket *always* making connection?
by wolfger (Deacon) on Feb 08, 2005 at 20:00 UTC

    Thanks for the reply. That was a good tip about "soft" failures, but that didn't solve my problem. I've rewritten the original post to try to be clearer, as well as getting rid of the evals.


    --
    Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
    perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'