Remove prototype causing warnings
[p5sagit/local-lib.git] / lib / local / lib.pm
index 173ae29..8533b1c 100644 (file)
@@ -8,10 +8,9 @@ use 5.008001; # probably works with earlier versions but I'm not supporting them
 
 use File::Spec ();
 use File::Path ();
-use Carp ();
 use Config;
 
-our $VERSION = '1.008004'; # 1.8.4
+our $VERSION = '1.008006'; # 1.8.6
 
 our @KNOWN_FLAGS = qw(--self-contained --deactivate --deactivate-all);
 
@@ -175,6 +174,7 @@ sub resolve_home_path {
     }
   };
   unless (defined $homedir) {
+    require Carp;
     Carp::croak(
       "Couldn't resolve homedir for "
       .(defined $user ? $user : 'current user')
@@ -375,7 +375,7 @@ my %ENV_LIST_VALUE_DEFAULTS = (
     filter => sub { 1 },
     empty => undef,
 );
-sub _env_list_value(%@) {
+sub _env_list_value {
   my $options = shift;
   die(sprintf "unknown option '$_' at %s line %u\n", (caller)[1..2])
     for grep { !exists $ENV_LIST_VALUE_DEFAULTS{$_} } keys %$options;
@@ -478,18 +478,9 @@ sub build_deactivate_environment_vars_for {
   # If removing ourselves from the "top of the stack", set install paths to
   # correspond with the new top of stack.
   if ($active_lls[-1] eq $path) {
-    if (@active_lls > 1) {
-      my $new_top = $active_lls[-2];
-      %env = (%env,
-        PERL_MB_OPT => "--install_base ${new_top}",
-        PERL_MM_OPT => "INSTALL_BASE=${new_top}",
-      );
-    } else {
-      %env = (%env,
-        PERL_MB_OPT => undef,
-        PERL_MM_OPT => undef,
-      );
-    }
+    my $new_top = $active_lls[-2];
+    $env{PERL_MB_OPT} = defined($new_top) ? "--install_base ${new_top}" : undef;
+    $env{PERL_MM_OPT} = defined($new_top) ? "INSTALL_BASE=${new_top}" : undef;
   }
 
   return %env;
@@ -1070,6 +1061,8 @@ G. de Oliveira <garu@cpan.org>.
 Improvements to stacking multiple local::lib dirs and removing them from the
 environment later on contributed by Andrew Rodland <arodland@cpan.org>.
 
+Patch for Carp version mismatch contributed by Hakim Cassimally <osfameron@cpan.org>.
+
 =head1 COPYRIGHT
 
 Copyright (c) 2007 - 2010 the local::lib L</AUTHOR> and L</CONTRIBUTORS> as