in reply to Re: prove can't find my module, even though its directory is in $INC[0]
in thread prove can't find my module, even though its directory is in $INC[0] (Solved)
require 'MAS::Global';
Just to hammer the point home, it is the format of this line which is the problem, not the line itself. By enclosing the module name in quotes it is no longer a bareword and therefore perl looks for a file with that exact name which of course it does not find because it does not exist. If you had omitted the quotes (as you did in the use statement) it would all have been fine. Here's a trivial illustration using a core module as an example:
$ perl -e 'use Fcntl; require "Fcntl";' Can't locate Fcntl in @INC (@INC contains: /usr/local/lib64/perl5 /usr +/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vend +or_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 1. $ perl -e 'use Fcntl; require Fcntl;' $
See how (and why) the first one with the quotes fails but the second one without the quotes succeeds? It's the same even without the use statement but I have left it in there to mirror your use case.
🦛
|
|---|