Re: Bus error in LWP/Perl5
Roy T. Fielding (fielding@avron.ICS.UCI.EDU)
Thu, 19 Oct 1995 18:57:53 -0700
>> 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.
.....Roy