Re: Bus error in LWP/Perl5

Tim Bunce (Tim.Bunce@ig.co.uk)
Fri, 20 Oct 1995 12:16:28 +0100


> From: "Roy T. Fielding" <fielding@avron.ics.uci.edu>
> 
> >> Nick, can you elaborate on the problems with IP addresses in URL's?
> > 
> > How about this elaboration:
> ...
> 
> >      elsif ($host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) {
> >          # numeric IP address
> > -        $addr[0] = [$1, $2, $3, $4];
> > +        $addr[0] = Socket::sockaddr_in(PF_INET, $port, $1, $2, $3, $4);
> 
> Yeah, that should do it -- the addresses are unsigned 8bit integers
> packed into a 4-byte structure.  The perl4 version used
> 
>     if ($host =~ /^\d+\.\d+\.\d+\.\d+$/)
>     {
>         $thataddr = pack('C4', split(/\./, $host));
>     }
> 
> and I'm glad to see that they put a real interface for it in perl5.

Sort off. The interface will probably change. I added it to Socket.pm
more as a place holder to encourage others to do more.

There is a very much enhanced Socket extension from Jack Shirazi
<JackS@slc.com> which will hopefully make it into Perl5.002.

Sadly, from your point of view, the sockaddr_in has been renamed
pack_sockaddr_in (there's also an unpack_sockaddr_in). Since the
sockaddr_in function was never exported or advertised (and was
simply a hard coded pack) I'd suggest you switch back for now
and wait till 5.002.

Tim.