Subject: | Only export PERL5LIB for SHLVL=1 |
local::lib puts its PERL5LIB entry at the start of PERL5LIB. This
causes problems for CPAN/CPANPLUS when people test (without installing
prerequisite) due to the way that CPAN/CPANPLUS add dependency blibs to
PERL5LIB.
During testing, in a bashrc, local::lib re-appends itself to the start
of the PERL5LIB set by CPAN/CPANPLUS, causing older modules to be
detected instead of newer dependencies in the blib directories.
One potential solution for this is to only modify PERL5LIB once, at the
top level of the shell. E.g.:
if [ $SHLVL -eq 1 ]; then
export ...
fi
Then, any subshells invoked by CPAN/CPANPLUS will still have local::lib
directories, but should have correct ordering of subsequent PERL5LIB
modifications.
I don't know what the csh equivalent is, but I'm sure something similar
could be done.
Another approach would be to use the PERL_LOCAL_LIB_ROOT variable as a
flag and not re-set PERL5LIB if PERL_LOCAL_LIB_ROOT is set.
-- David