Skip Menu |

This queue is for tickets about the local-lib CPAN distribution.

Report information
The Basics
Id: 66534
Status: resolved
Priority: 0/
Queue: local-lib

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 2.000003



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
On 2011-03-10 15:17:41, DAGOLDEN wrote: Show quoted text
> 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.
Anyone care to volunteer to tackle this issue?
I'm not convinced this is a good approach to take. There are plenty of uses for setting up a local::lib when one is already active, or even re-activating one that is already active. Instead, I'd favor a documentation patch. Either mentioning $SHLVL or saying to put the code in .bash_profile instead.
Documentation updated to recommend using $SHLVL check. Included in dev release 2.000_000.
Resolved in 2.000003