Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Fellow monks,
I'm getting unexpected behavior using  use lib; It seems that the only directory my module can be found in is a subdirectory of the directory out of which the pages are being served. Also, when I don't  use lib; and put the module in my PERL5LIB directory, Perl complains that it cannot be found. I have verified that all is setup correctly. Here is what I have: (in the script)
use lib "/home/davidj/perl/lib/survey";
directory listing:
andromeda:davidj lib > pwd /home/davidj/perl/lib/survey andromeda:davidj survey > ls -l total 4 -rw-r--r-- 1 davidj users 1444 Oct 23 03:09
http error output:
[Mon Oct 23 03:23:49 2006] [error] [client] Can't locate sur in @INC (@INC contains: /home/davidj/perl/lib/survey /usr/lib/ +perl5/site_perl/5.8.8/i386-linux-thread-multi .....
I have tested other directories and nothing seems to work. However, if I do this:
use lib "/var/www/cgi-bin/survey/lib/";
and put the module file in that directory, with the pages being served out of /var/www/cgi-bin/survey, it all works fine.

It is fine for me to store modules in the application subdirectories. I'm just wondering why Perl cannot find them anywhere else, including my exported PERL5LIB directory.


In reply to unexpected use lib behavior by davidj

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?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2023-09-21 11:14 GMT
Find Nodes?
    Voting Booth?

    No recent polls found