I have a cgi script that uses
LWP::UserAgent to get some weather information from a National Weather Service web site and then displays certain pieces in my format. It is not on the web server I originally created it on, but it worked fine when I transferred it. I started getting errors in the web log with the script and did some investigating. It turned out the problem was with the NWS web page and the script is now working again.
However, when I started testing it I tried running the script from a Unix prompt and I got the following error message:
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) at weather.pl line 9. BEGIN failed--compilation aborted at weather.pl line 9.
I am not at all familiar with perl module installation mainly because I have no control over the modules on the server I'm using. I got some information about the perl modules on the server and found out that the perl version installed is RPM:perl-5.00502-18 and has been that version since March 2002, the only updates being to the File::Spec and GD modules.
One of my questions is, why is my script looking for LWP in /usr/local/lib/perl5/5.8.0? At the top of my script I have
#!/usr/bin/perl -Tw and line 9 that generates the error is
use LWP::UserAgent;.
Also, since the error message says "BEGIN failed--compilation aborted", why is the script actually working on the web page?