Omniscient Monks,

i try to "use lib" in a cgi environment.

datastructure:

# test environment
/home/user/test-workspace/trunk/index.pl
..
/home/user/test-workspace/trunk/modules/
/home/user/test-workspace/trunk/modules/upload.pm
/home/user/test-workspace/trunk/modules/download.pm
..

# productive environment
/home/user/webpage/trunk/index.pl
..
/home/user/webpage/modules/
/home/user/webpage/modules/upload.pm
/home/user/webpage/modules/download.pm
..

Server Root = /home/user/anotherPage/

/home/user/test-workspace/trunk/index.pl
use lib "modules"; use upload; print $upload::variable;
use lib (randomly?) looks in the wrong directory
/home/user/webpage/modules/

i tried FindBin, but itīs completely weird.

he gets the upload.pm out of the relative /modules (/home/user/test-workspace/trunk/modules/upload.pm)
but the other modules are loaded from here:/home/user/webpage/modules/download.pm
- i dont understand that..

i see that there are actually three locations
print $_ . " => " . $INC{$_} . "<br>" for keys %INC;
download.pm => modules/download.pm
upload.pm => /home/user/webpage/modules/upload.pm
transfer.pm => /home/user/test-workspace/trunk/module/transfer.pm

but all of them should be located in
/home/user/test-workspace/trunk/modules/

kindly.. perlig.
$perlig =~ s/pec/cep/g if 'errors expected';

In reply to use lib in cgi env by AlexTape

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.