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?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.