Re: Socket Errors with Perl5.001n
Ade Miller (asm@npac.syr.edu)
Sat, 13 Jan 1996 09:18:24 -0500 (EST)
I managed a hack which involved a bit of a rewrite of the
LWP::Socket::_getaddress() method to use a different number of
parameters for the Socket::pack_sockaddr_in() function. I guess this
function has changes in perl5.001n and this is causin the problems (my
guess only).
There are references to an official patch for this, which is why I
didn't release mine.
The official patch for this problem is not at
ftp://perl.com/pub/perl/ext/Socket-1.3.tar.gz which is where Tom C.
said it was. However it is outlined in his mail posting. I'll put it
together and post it here if the original is not available.
ALSO: It was also noted in the same messages that patch level n was not
recommended, but nobody has explained why. Is there something we should
know?
>
> I found your message from Sat, 30 Dec 1995, below, in the libwww-perl archives.
>
> I also installed libwww-perl5b6 (on a solaris 2.4 box) with per5.001n, and
> got the same error you mentioned.
>
> How'd you hack the LWP::Socket.pm file? Did you pass the ".../t/Test net" tests?
>
> Any other solutions?
>
> Are you still running 5.001n?
>
> Cheers,
> Steve
>
> -------------------
> 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
>
>
>
--
Ade Miller Email: asm@npac.syr.edu
Webmaster Phone: (315) 443-5735
NPAC Fax: (315) 443-1973
111 College Pl., Rm 2-123 CST http://www.npac.syr.edu/
Syracuse, NY 13244-4100 http://www.infomall.org/