Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

K,

It looks as though @INC for you doesn't include a version of perl with LWP::UserAgent.pm installed, whereas @INC for the webserver (usually 'nobody') does use a version of perl with the module.

First off, run this cmd: locate perl | more That will show you all the places where perl is installed on the machine. My suspicion is that you have two versions of perl installed: 5.8.x is installed for users, and the web server is using some other version. If so, you'll see this kind of thing (minus my comments w arrows):

... /usr/lib/perl5/5.6.0 <--- version 5.6.0 of perl ... /usr/local/lib/perl5/5.6.1/CGI.pm <--- diff version --More--

Edit: I didn't notice that you said the webserver is using 5.005x. Teach me not to read carefully.

You (meaning your user account) seems to be using 5.8.x, which has no LWP::UserAgent.pm installed.

You haven't said why you've decided to test this CGI script by running it from the command line, but you might consider using CGI::Carp, which will send error messages to the browser. And since it will be running as the web server, it will execute using the 5.005x version of perl that has LWP.

Another solution is to remove the 5.8x version of perl from your $PATH variable, and add the 5.005x version. To do so, you'll have to find the 5.005x version--use 'locate perl | grep "5.005" | more; or something similar, and add the path to the 5.005 interpreter to your $PATH.

AH


In reply to Re: Re: Re: Can't locate LWP/UserAgent.pm by alienhuman
in thread Can't locate LWP/UserAgent.pm by kryberg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found