Revision history for local::lib
+ - Set PERL5LIB back to calculated @INC with --self-contained, to stop
+ invoking other perl scripts from losing the local::lib if they
+ mangle @INC from $ENV{PERL5LIB} (t0m)
+
1.004002 2009-06-15
- - Fixed up INC untaint procedure to skip/ignore CODE, ARRAY, blessed entries.
+ - Fixed up INC untaint procedure to skip/ignore CODE, ARRAY,
+ blessed entries. (grink)
- Include test in xt/ for the above
- Put PERL5LIB first, so it'll be favored over privlibexp and
if ($flag eq '--self-contained') {
# The only directories that remain are those that we just defined and those where core modules are stored.
# We put PERL5LIB first, so it'll be favored over privlibexp and archlibexp
- @INC = ($Config::Config{privlibexp}, $Config::Config{archlibexp}, split $Config{path_sep}, $ENV{PERL5LIB});
- @INC = (
+ my %seen;
+ @INC = grep { ! $seen{$_}++ } (
$class->install_base_perl_path($path),
$class->install_base_arch_path($path),
split( $Config{path_sep}, $perl5lib ),
$Config::Config{archlibexp}
);
- # We explicitly set PERL5LIB here (back to what it was originally) to prevent @INC from growing with each invocation
- $ENV{PERL5LIB} = $perl5lib;
+ # We explicitly set PERL5LIB here to the above de-duped list to prevent
+ # @INC from growing with each invocation
+ $ENV{PERL5LIB} = join( $Config{path_sep}, @INC );
}
elsif (defined $flag) {
die "unrecognized import argument: $flag";