Re: problams with IO::Socket::INET

Graham Barr (gbarr@pobox.com)
Tue, 27 Jan 1998 19:30:50 -0600


Gisle Aas wrote:
> 
> Graham Barr <gbarr@ti.com> writes:
> 
> > Now on the other hand I do not know of anyone who uses it
> > in this way, so I could change IO::Socket::INET to croak
> > on illegal arguments, but if someone complains then I
> > may have to change it back.
> 
> One good thing about not croaking is that
> 
>    $sock = IO::Socket::INET->new(PeerAddr   => "www.microsoft.com:http(80)",
>                                  MultiHomed => 1);
> 
> actually works for all versions, even only the latest know about
> MultiHomed.  I would prefer not to croak.

While that is a good point, I think Tom's point is stronger. I do
see a lot of messages asking for help where the user has just spelt
things wrong.

> 
> Using the single argument version of the constructor also reduces the
> risk of misspelling.
> 
>   $sock = IO::Socket::INET->new("www.perl.com:80") || die;

Another good point.

Graham.