use CPAN;\r
use Cwd;\r
use File::Spec;\r
-my $target = Cwd::abs_path($ENV{TARGET})\r
- or die "set \$ENV{TARGET} to your desired local::lib dir\n";\r
+my $target = $ENV{TARGET} ? Cwd::abs_path($ENV{TARGET}) : undef;
\r
my $mod = CPAN::Shell->expand(Module => "local::lib");\r
$mod->get;\r
my $dir = CPAN::Shell->expand(Distribution => $mod->cpan_file)->dir;\r
chdir($dir);\r
my $make = $CPAN::Config->{make};\r
-system($^X, 'Makefile.PL',"--bootstrap=$target") && exit 1;\r
+my $bootstrap = $target ? "--bootstrap=$target" : "--bootstrap"
+system($^X, 'Makefile.PL', $bootstrap) && exit 1;
system($make, 'test') && exit 1;\r
system($make, 'install') && exit 1;\r