in reply to Perl too smart require()ing libs

Didn't see anyone comment on this, but:
use lib '.';
is basically a no-op (unless you're root, where that's removed).

If your intent is to add the directory of the module/script to the @INC path, that's definitely not going to do it. You'll need something more like:

use File::Basename qw(dirname); use lib dirname(__FILE__);

Replies are listed 'Best First'.
Re^2: Perl too smart require()ing libs
by runrig (Abbot) on Jun 22, 2007 at 23:17 UTC
    Didn't see anyone comment on this, but: use lib '.'; is basically a no-op (unless you're root, where that's removed).
    Actually, I had a use for this today. I have PERL5LIB set to some custom locations, but had a test version of a library in the current directory. I needed 'use lib qw(.)' in my test program in order to override what PERL5LIB had in it. Or I could've put "." at the front of PERL5LIB...yeah, it's a different intent than what you (probably correctly) assumed from the OP, but it's not completely a "no-op" :-)