Re: alarm function in UserAgent.pm

Paul Schinder (schinder@pjstoaster.pg.md.us)
Wed, 03 Apr 96 21:32:02 -0500


"Martin RJ Cleaver (x5143) x5143" <martin.cleaver@reuters.com> writes:
Subject: Re: alarm function in UserAgent.pm
} >Saima Sami <ssami@vax2.cstp.umkc.edu> writes:
} >} Hi,
} >}    I am working with Perl 5.001m for Windows NT. I have installed
} >} libwww-perl 5b6 on my computer. 
} 
} U:\>perl -e "use LWP::Simple; getprint(qw(http://www.reuters.com));"
} Can't locate auto/LWP/Socket/autosplit.ix in @INC at
} C:/win32app/perl5/lib/AutoLoader.pm line 66.
}  at u:/perl-extra-libs/standard/LWP/Socket.pm line 7
} <HTML>
} <HEAD>
} <TITLE>
} An Error Occurred
} </TITLE>
} </HEAD>
} <BODY>
} <H1>An Error Occurred</h1>
} Can't locate auto/Winsock/sockaddr_in.al in @INC
} 
} </BODY>
} </HTML>
} 
} Any ideas of what I have done wrong? I don't understand where
} this autoloader should be looking.
} I am using LWP beta 6 on NT 3.51 and Perl 5.001m.

I've had the great good fortune never to use Windows, so I can only
guess, but a similar thing happened to me with MacPerl.  The Socket.pm
that ships with MacPerl does not have a sockaddr_in defined inside of
it.  I'll bet the one you have doesn't, either.  I'm guessing that Perl
doesn't find one already defined, so Autoloader tries to hunt one down
and fails.

My solution was to simply copy the one from the 5.001m Socket.pm on my
Sun workstation to my Mac, and it worked.  (Suns and Macs grew up on
the same chip family, though, even though the OS's are completely
different, so this may not work for an Intel. sockaddr_in packs a
binary structure in the way needed for, for example, bind(), and this
seems likely to be machine and/or Perl implementation specific.)
However, sockaddr_in has changed significantly in 5.002, and now
requires two routines that are written in C in the standard Socket.pm
distribution. You can rewrite these routines, pack_sockaddr_in and
unpack_sockaddr_in, in Perl (I had to do this to get Net::FTP working
in MacPerl), but again you need to know what pattern to tell pack() to
use.

So if I were you, the first thing I'd do is hunt down a Unix 5.001m
Socket.pm, cut the sockaddr_in out of it, and stick it in the one in
your Perl lib folder.  If that doesn't work, you're going to have to
figure out what pattern you have to pack() with to get it to work.

} 
} Many Thanks,
} 	Martin.
} --
} Martin.Cleaver@reuters.com
} 
} 
} 
---
--------
Paul J. Schinder
NASA Goddard Space Flight Center,
Code 693, Greenbelt, MD 20771 USA
schinder@pjstoaster.pg.md.us