in reply to prove can't find my module, even though its directory is in $INC[0]
There are two things I might suggest:
In the output you provided you gave perl -c /home/henry/gitr/MAS/lib/MAS/Global.pl as an example to show that perl could find it; however, that command would only check the syntax of the file name you provided (the full path to the module). By running perl -c ./t/8bit.t you have perl check the syntax of the test file (it's perl code too, after all), and if it can see the module it should pass.
prove's -I option adds a library path for prove to include when running. prove's man page includes this comment about @INC:
@INCIt looks as if using the -I option might add the given path you need to have the test complete successfully.
prove introduces a separation between "options passed to the perl which runs prove" and "options passed to the perl which runs tests"; this distinction is by design. Thus the perl which is running a test starts with the default @INC. Additional library directories can be added via the "PERL5LIB" environment variable, via -Ifoo in "PERL5OPT" or via the "-Ilib" option to prove.
Hope that helps.
|
|---|
| 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 08:56 UTC | |
by atcroft (Abbot) on Dec 15, 2025 at 09:27 UTC | |
by choroba (Cardinal) on Dec 15, 2025 at 09:36 UTC | |
by HenryLaw (Novice) on Dec 15, 2025 at 09:59 UTC | |
by LanX (Saint) on Dec 15, 2025 at 11:40 UTC | |
by LanX (Saint) on Dec 15, 2025 at 21:16 UTC |