I'm running tests which are in a ./t subdirectory. Tests are failing with "Can't locate so-and-so in @INC", despite the fact that the missing module is in the first directory named in the dump of @INC. I have $PERL5LIB set. Thus:

# echo $PERL5LIB /home/henry/gitr/MAS/lib # prove ./t/8bit.t ./t/8bit.t .. Can't locate MAS::Global in @INC (@INC entries checked: +/home/henry/gitr/MAS/lib /etc/perl (... others omitted) # find /home/henry/gitr/MAS/lib -name Global.pm /home/henry/gitr/MAS/lib/MAS/Global.pm # It's in $INC[0] # perl -c /home/henry/gitr/MAS/lib/MAS/Global.pm /home/henry/gitr/MAS/lib/MAS/Global.pm syntax OK

Perl itself can find it:

# perldoc -l MAS::Global /home/henry/gitr/MAS/lib/MAS/Global.pm

Compiler and OS details

# perl -v This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-li +nux-gnu-thread-multi (with 51 registered patches, see perl -V for more detail) # cat /etc/os-release NAME="Linux Mint" VERSION="22.2 (Zara)" ID=linuxmint ID_LIKE="ubuntu debian" ... etc

I'm fairly sure there's a sensible explanation for this baffling behaviour: would someone either diagnose my error, or suggest some way by which I can home in on what it is?


In reply to prove can't find my module, even though its directory is in $INC[0] by HenryLaw

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.