bump version for release
[p5sagit/local-lib.git] / lib / local / lib.pm
index a97a78f..2e477e6 100644 (file)
@@ -10,7 +10,7 @@ use File::Spec ();
 use File::Path ();
 use Config;
 
-our $VERSION = '1.008007'; # 1.8.4
+our $VERSION = '1.008011'; # 1.8.11
 
 our @KNOWN_FLAGS = qw(--self-contained --deactivate --deactivate-all);
 
@@ -234,7 +234,15 @@ sub setup_local_lib_for {
     exit 0;
   } else {
     $class->setup_env_hash_for($path, $deactivating);
-    @INC = _uniq(split($Config{path_sep}, $ENV{PERL5LIB}), @INC);
+    my $arch_dir = $Config{archname};
+    @INC = _uniq(
+  (
+      # Inject $path/$archname for each path in PERL5LIB
+      map { ( File::Spec->catdir($_, $arch_dir), $_ ) }
+      split($Config{path_sep}, $ENV{PERL5LIB})
+  ),
+  @INC
+    );
   }
 }
 
@@ -397,7 +405,7 @@ sub _env_list_value {
                  && (!$options{exists} || -e $_))
     } map {
       if (ref $_ eq 'SCALAR' && $options{interpolate} == INTERPOLATE_ENV) {
-        exists $ENV{${$_}} ? (split /\Q$Config{path_sep}/, $ENV{${$_}}) : ()
+        defined $ENV{${$_}} ? (split /\Q$Config{path_sep}/, $ENV{${$_}}) : ()
       } else {
         $_
       }
@@ -419,13 +427,12 @@ sub build_activate_environment_vars_for {
     PERL5LIB =>
             _env_list_value(
               { interpolate => $interpolate, exists => 0, empty => '' },
-              $class->install_base_arch_path($path),
               $class->install_base_perl_path($path),
               \'PERL5LIB',
             ),
     PATH => _env_list_value(
               { interpolate => $interpolate, exists => 0, empty => '' },
-             $class->install_base_bin_path($path),
+        $class->install_base_bin_path($path),
               \'PATH',
             ),
   )
@@ -1017,6 +1024,14 @@ On Win32 systems, C<COMSPEC> is also examined.
 
 =back
 
+=head1 SEE ALSO
+
+=over 4
+
+=item * L<Perl Advent article, 2011|http://perladvent.org/2011/2011-12-01.html>
+
+=back
+
 =head1 SUPPORT
 
 IRC: