X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=blobdiff_plain;f=lib%2Flocal%2Flib.pm;h=9440ad33c97d787fce1de2cdd72f7f8c19b9fcb3;hp=1054bdc14fe3d8b1238e1343673a3d661a438e14;hb=69b801068fe0db14eda9fabf2683d2644b2e1224;hpb=53699c992388febac03ba5b9b967e935bebafd17 diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 1054bdc..9440ad3 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -41,8 +41,8 @@ DEATH 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 ), @@ -50,8 +50,9 @@ DEATH $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";