adding docs on how to maintain multiple perls
[p5sagit/local-lib.git] / lib / local / lib.pm
index 5632832..307eb32 100644 (file)
@@ -8,7 +8,6 @@ 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
@@ -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')
@@ -601,6 +601,12 @@ to specify the name of the directory when you call bootstrap, as follows:
 
   perl Makefile.PL --bootstrap=~/foo
 
+If you're using multiple versions of perl via something like
+L<perlbrew>, it might be useful to bootstrap to a specific directory
+for the current version of perl you're running:
+
+  perl Makefile.PL --bootstrap=$HOME/perl5/$(perl -e 'print $]')
+
 3. Run this: (local::lib assumes you have make installed on your system)
 
   make test && make install
@@ -624,6 +630,12 @@ import parameter to the call of the local::lib module like this way:
 
   echo 'eval $(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)' >>~/.bashrc
 
+If you used the perl-version-specific bootstrap before, you'll need:
+
+  echo "eval $(perl -Mlocal::lib=$HOME/perl5/$(perl -e 'print $]'))" >>~/.bashrc
+
+Make sure you re-eval C<.bashrc> every time you switch perls.
+
 After writing your shell configuration file, be sure to re-read it to get the
 changed settings into your current shell's environment. Bourne shells use 
 C<. ~/.bashrc> for this, whereas C shells use C<source ~/.cshrc>.
@@ -1061,6 +1073,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