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";
andromeda:davidj lib > pwd
andromeda:davidj survey > ls -l
-rw-r--r-- 1 davidj users 1444 Oct 23 03:09 survey.pm
http error output:
[Mon Oct 23 03:23:49 2006] [error] [client 127.0.0.1] Can't locate sur
+vey.pm in @INC (@INC contains: /home/davidj/perl/lib/survey /usr/lib/
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.
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||