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

Does prove --lib ... work?
  • Comment on Re: prove can't find my module, even though its directory is in $INC[0]
  • Download Code

Replies are listed 'Best First'.
Re^2: prove can't find my module, even though its directory is in $INC[0]
by HenryLaw (Novice) on Dec 15, 2025 at 19:05 UTC

    No; prove -l gives the same result (in fact that's what I usually enter, by force of habit).

    prove -l ./t/8bit.t reports that /home/henry/gitr/MAS/lib is in the path and then fails to find Global.pm, even though /home/henry/gitr/MAS/lib/MAS/Global.pm exists, and contains contains the line package MAS::Global;

      contains contains the line package MAS::Global;

      The package directive is irrelevant. That's not used to load a module. (It can be relevant to the later step of importing symbols when using use, but the error happens before that.)

      and then fails to find Global.pm

      Not quite. The issue isn't that perl can't find Global.pm (or rather, MAS/Global.pm); it's that it's not even looking for it. As previously explained, the message indicates it's looking for a file named MAS::Global (i.e. /home/henry/gitr/MAS/lib/MAS::Global). No such file exists, thus the failure.

      In the earlier post where I explained this, I requested that you start by providing the complete (unedited) error message (referring the output from prove ./t/8bit.t) if you were still having issues.

      Can you show 8bit.t? You said this doesn't happen in a different environment, are the repo files all the same when it doesn't happen?