use lib::core::only; # now @INC contains only the two core directories
- # To get only the core directories plus the ones for the local::lib in
- # scope
+To get only the core directories plus the ones for the local::lib in scope:
- $ perl -Mlib::core::only -Mlocal::lib=~/perl5 myscript.pl
+ $ perl -mlocal::lib -Mlib::core::only -Mlocal::lib=~/perl5 myscript.pl
+
+To attempt to do a self-contained build (but note this will not reliably
+propagate into subprocesses, see the CAVEATS below):
+
+ $ PERL5OPT='-mlocal::lib -Mlib::core::only -Mlocal::lib=~/perl5' cpan
+
+Please note that it is necessary to use C<local::lib> twice for this to work.
+First so that C<lib::core::only> doesn't prevent C<local::lib> from loading
+(it's not currently in core) and then again after C<lib::core::only> so that
+the local paths are not removed.
=head1 DESCRIPTION
lib::core::only is simply a shortcut to say "please reduce my @INC to only
-the core lib and archlib directories of this perl".
+the core lib and archlib (architecture-specific lib) directories of this perl".
You might want to do this to ensure a local::lib contains only the code you
need, or to test an L<App::FatPacker|App::FatPacker> tree, or to avoid known