You said you got this error message:

Can't locate MAS::Global in @INC [...]

The error message indicates that Perl is looking for a file named MAS::Global when you want it to look for a file named MAS/Global.pm.

This happens, like choroba said, when require "MAS::Global"; is used instead of require MAS::Global; or require "MAS/Global.pm";.

$ perl -e'require "MAS::Global";' # Bad Can't locate MAS::Global in @INC [...] at -e line 1. $ perl -e'require MAS::Global;' # Ok Can't locate MAS/Global.pm in @INC [...] at -e line 1. $ perl -e'require "MAS/Global.pm";' # Ok Can't locate MAS/Global.pm in @INC [...] at -e line 1.

So check again, because require "MAS::Global"; or equivalent is definitely used somewhere in your code. The full error message will even say in what file and on what line. Add use Carp::Always; if you need a stack trace.

If you're still unable to find the problem, start by providing the full (unedited) error message.


In case you need it, the following is a portable method of converting a package name to a path for require:

# Equivalent to what `if.pm` uses. my $require_path = $pkg_name =~ s{::}{/}gr . ".pm";

In reply to Re^3: prove can't find my module, even though its directory is in $INC[0] by ikegami
in thread prove can't find my module, even though its directory is in $INC[0] (Solved) 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.