Paul Evans via RT wrote:
Show quoted text>Since not every error that might stop the constructor can be represented
>by an errno value, it is the general protocol of IO::Socket and
>subclasses to use $@ instead to signify an error.
Oh, hmm. Confusing, since that makes it different from all the other
I/O interfaces. Not documented for IO::Socket or IO::Socket::INET.
I see IO::Socket::IP does document filling $@, but even it omits to say
what it'll actually return on error.
Show quoted text>On the Principle of Least Surprise I suppose the constructor ought to
>set something by way of an error, though. Perhaps EINVAL is the best
>choice here,
Upon looking at the code, it turns out IO::Socket::INET is deliberately
returning EINVAL as well as populating $@.
-zefram