[lug] @INC problems
Tkil
tkil at scrye.com
Tue Oct 31 18:47:08 MST 2000
>>>>> "John" == John Starkey <jstarkey at advancecreations.com> writes:
John> push (@INC, "/var/neomail")
John> to
John> push (@INC, ".")
note that "require" is done at compile-time, before any statements are
executed. if you want to make sure that /var/neomail is on the
include path, use:
use lib '/var/neomail';
at the top of your script.
my overall feeling so far is that this shouldn't be this hard, and
that something really obvious is missing. i don't know what that
would be, tho.
(and it seems that screwy permissions will in fact cause the "can't
find" error:
| $ touch foo.pm
| $ chmod 0 foo.pm
| $ ls -al foo.pm
| ---------- 1 tkil tkil 0 Oct 31 18:44 foo.pm
| $ perl -Mfoo -lwe 'print "hi mom"';
| Can't locate foo.pm in @INC (@INC contains:
| /usr/lib/perl5/5.00503/i386-linux
| /usr/lib/perl5/5.00503
| /usr/lib/perl5/site_perl/5.005/i386-linux
| /usr/lib/perl5/site_perl/5.005
| .).
| BEGIN failed--compilation aborted.
| $ chmod 644 foo.pm
| $ perl -Mfoo -lwe 'print "hi mom"';
| foo.pm did not return a true value.
| BEGIN failed--compilation aborted.
| $ echo "1;" >> foo.pm
| $ perl -Mfoo -lwe 'print "hi mom"';
| hi mom
so you might want to make sure that the permissions really are
correct.
t.
More information about the LUG
mailing list