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.
In reply to PERL5LIB mystery by jalucas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |