jalucas has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am having a problem using PERL5LIB. I have a directory 'H:/tools/perl_libs/' that is mapped to a Windows remote drive. My PERL5LIB environment variable is set as:
PERL5LIB="H:/tools/perl_libs C:/Perl_5_8_8_822/lib C:/Perl_5_8_8_822/site/lib"
The following code fails. I expect it to find <H:/tools/perl_libs/Memory.pm> as defined in PERL5LIB, but it does not. The code and the error message are provided below:
CodeOutputuse strict; #use lib 'H:/tools/perl_libs'; use Memory; use Does::Not::Exist;
Can't locate Memory.pm in @INC (@INC contains: H:/tools/perl_libs C:/Perl_5_8_8_822/lib C:/Perl_5_8_8_822/site/lib C:/Perl_5_8_8_822/site/lib C:/Perl_5_8_8_822/lib .) at ...
The following code works just fine. Memory.pm is found. For whatever reason, defining my directory with use lib ... works but defining in PERL5LIB doesn't seem to. The use Does::Not::Exist; is used to cause a failure and dump the @INC array. Note that <H:/tools/perl_libs> appears as the first two entries in @INC.
CodeOutputuse strict; use lib 'H:/tools/perl_libs'; use Memory; use Does::Not::Exist;
Can't locate Does/Not/Exist.pm in @INC (@INC contains: H:/tools/perl_libs H:/tools/perl_libs C:/Perl_5_8_8_822/lib C:/Perl_5_8_8_822/site/lib C:/Perl_5_8_8_822/site/lib C:/Perl_5_8_8_822/lib .) at ...
Does anyone know why the use lib ... would work but PERL5LIB wouldn't?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PERL5LIB mystery
by Corion (Patriarch) on Mar 04, 2009 at 17:00 UTC | |
by Anonymous Monk on Mar 04, 2009 at 17:48 UTC | |
|
Re: PERL5LIB mystery
by toolic (Bishop) on Mar 04, 2009 at 17:12 UTC | |
|
Re: PERL5LIB mystery
by locked_user sundialsvc4 (Abbot) on Mar 04, 2009 at 17:26 UTC |