Socket Errors with Perl5.001n

Ade Miller (asm@npac.syr.edu)
Sat, 30 Dec 1995 19:17:24 -0500 (EST)


Hi,

I've just installed libwww-perl5b6 on a Solaris 2.5 box with perl5.001n.
I also get this error, but managed to fix it by hacking the LWP::Socket.pm
file.  I'd like to install the official patch mentioned below but have been
unable to find it on the ftp site given here.  Is there a patch for this at
present, where can I get it?

Also,  I noticed in one of the followup postings that perl5.001m was the
recommended version of Perl to use and that patch level n was not
recommended.  Is there something I should know about patch level n? 
Would I be better off installing patch m if n is very buggy?  Is this a
general thing or just related to the libwww code?

Ade

>Hi All,
> >  I've just finished installing Perl5.001l and libwww-perl-5b6.
> >I had been using the Perl4 versions of both.  And now I am getting the 
> >following error using both the GET and request programs:
> 
> >Can't locate auto/Socket/sockaddr_in.al in @INC
> 
> >I hope this is a Perl5 NEWBIE question <grin>
> >like I need to use the Socket.pm in Perl5 and not the one in LWP <????>
> 
> >Can any one point me in the right direction? 
> 
> Hm... no, you should be able to use the standard one, but we've been 
> playing with it.  (I also think I disagree with some of LWP::Socket.pm,
> but that's another matter.)
> 
> I recently tried to release a "unified" Socket.pm that unified Gisle's,
> Jack's, and my interfaces in v1.2 of the Socket module.  I was very close:
> Here's v1.2 sockaddr_in, trying to be many things to many people
> 
>     sub sockaddr_in {
>         if (@_ == 6 && wantarray) { # perl5.001m compat; use this && die
>             my($af, $port, @quad) = @_;
>             pack_sockaddr_in($port, inet_aton(join('.', @quad)));
>         } elsif (wantarray) {
>             unpack_sockaddr_in($_[0])
>         } else {
>             pack_sockaddr_in(@_[0,1])
>         }
>     }
> 
> The bug is that the first wantarray should be negated:
> 
>     sub sockaddr_in {
>         if (@_ == 6 && !wantarray) { # perl5.001m compat; use this && die
>             my($af, $port, @quad) = @_;
>             pack_sockaddr_in($port, inet_aton(join('.', @quad)));
>         } elsif (wantarray) {
>             unpack_sockaddr_in($_[0])
>         } else {
>             pack_sockaddr_in(@_[0,1])
>         }
>     }
> 
> The LWP stuff now works -- at least, I tested HEAD and got proper results,
> which I didn't get with the 1.2 :-(, so I've put a new Socket-1.3 with this
> fix in ftp://perl.com/pub/perl/ext/Socket-1.3.tar.gz for your fetching.
> 
> If you really really want to, you should now be able to say
> 
>     use Socket 1.3;
> 
> and be happy.
> 
> --tom
> 
>     I'm not sure I'm fond of the notion of our supporting that 6-arg
>     version forever.  Hence the comment.  Maybe someday it's start
>     eliciting -w warnings, then mandatory warnings, then boom! :-)
> 
> 
> 

-- 
Ade Miller                      asm@npac.syr.edu
Webmaster                       http://www.npac.syr.edu/	
NPAC                            http://www.infomall.org/
111 College Pl.,  Rm 2-123    
Syracuse, NY 13244-4100