I just created a new virtual machine under VMWare 4.5 and installed SuSE Linux 9.1 on it. I didn't make any changes to the PERL or Apache2 installation options. A lot of scripts that have always worked perfectly (on previous installs of SuSE and other Linux flavors both as virtual machines and on "real" machines) are now broken. Every time I use "use" to include a package that is not part of the PERL installation, PERL claims it can't find the .pm file. For example, foo.pl is located in /home/mydir/perl/foo. In foo.pl I eval "use Mypackage" and when I run the script through a browser, $@ contains the error "Can't find Mypackage.pm in @INC..." The listing of paths contained in @INC _does_ include /home/mydir/perl/foo. This is happening with every script I've written. In the scripts, I add the path to the script files to @INC and when the error is generated, I see that @INC _does_ contain the directory where the supposedly missing .pm definitely _does_ reside. So, the path is in @INC and the file in in the path but PERL swears it can't find the file.

Standard PERL packages load just fine using "use" and the scripts all work if I run them from the command line as long as I am in the directory that contains the script files. If I run the script from another path or through a browser, I get the @INC error every time for every package I try to use.


In reply to Odd "use" problem by Anonymous Monk

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.