Problem using LWP::UserAgent

G

Gaurav

Hello,

I have a perl script which fetches data from yahoo finance. I last
used it in Jan 2003 i guess. Now if i try to use it i get an error
message.

This is the error message i get if i try to run my script using a
makefile
**********************************
make
perl data.pl 4 1 2002 6 30 2002
Can't locate LWP/UserAgent.pm in @INC (@INC contains:
/usr/perl5/5.00503/sun4-so
laris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/sun4-solaris
/usr/perl5/site
_perl/5.005 .) at Web.pm line 12.
BEGIN failed--compilation aborted at data.pl line 10.
make: *** [run] Error 2
*******************************

My perl script is data.pl
***********************************
#! /usr/local/bin/perl
----
-----
# To run the script type perl data.pl 3 01 00 3 01 02
#format is perl data.pl start_month start_day start_year end_month
end_day end_$

#importing package Web
use Web; //THIS IS LINE 10
#creating an instance of Web module
$web = Web->new;
--------
-------
**********************************

My perl module is Web.pm
*******************************
--------
--------
package Web;

#LWP::UserAgent class implements WWW user agent in perl refer this
website
#for more details , http://www.perldoc.com/perl5.6/lib/LWP/UserAgent.html
require LWP::UserAgent; //THIS IS LINE 12

----
----
********************************

Can someone tell me why my script is not running anymore ?

Thank you in advance.

Gaurav
 
T

Tad McClellan

Can't locate LWP/UserAgent.pm in @INC (@INC contains:

#creating an instance of Web module
$web = Web->new;


You don't create instances of modules, you create instances of _objects_.

Can someone tell me why my script is not running anymore ?


Because Perl cannot find the LWP::UserAgent module.

Is it under any of the @INC directories that were listed?

Is it installed? If so, where? (ask your sysadmin)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top