Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl Error

Not sure what this means...

         

newnewbie1

3:17 pm on Mar 24, 2003 (gmt 0)

10+ Year Member



Hi!

I'm a perl newbie, and I'm getting this error when running a script. See below:

Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.0/mach /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach /usr/local/lib/perl5/5.8.0 .)

Looks like it can't find the LWP/UserAgent module... What's that for anyway?

They just installed Perl on this server, and I don't think they installed everything...

andreasfriedrich

3:52 pm on Mar 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The LWP::UserAgent [perldoc.com] is a class implementing a World-Wide Web user agent in Perl [perl.com].

How to install it will depend on whether you have shell access or not.

If so then

[url=http://www.perl.com/]Perl[/url] -M[url=http://www.perldoc.com/perl5.8.0/lib/CPAN.html]CPAN[/url] -e '[url=http://www.cpan.org/]CPAN[/url]::Shell->install("LWP::UserAgent")'
will do the trick.

In a Perl [perl.com] script you could do

[url=http://www.perldoc.com/perl5.8.0/pod/func/use.html]use[/url] [url=http://www.perldoc.com/perl5.8.0/lib/CPAN.html]CPAN[/url]; [url=http://www.perldoc.com/perl5.8.0/lib/CPAN.html]CPAN[/url]::Shell->install("LWP::UserAgent");
.

HTH Andreas

dive into perl

6:19 pm on Mar 24, 2003 (gmt 0)

10+ Year Member



LWP is available from CPAN [cpan.org], and here is a tutorial [perlmonks.org] on how to install Perl modules under Unix and Windows with or without root access.