package local::lib;
-use 5.8.1; # probably works with earlier versions but I'm not supporting them
- # (patches would, of course, be welcome)
+use 5.008001; # probably works with earlier versions but I'm not supporting them
+ # (patches would, of course, be welcome)
use File::Spec ();
use File::Path ();
use Carp ();
use Config;
-our $VERSION = '1.001000'; # 1.1.0
+our $VERSION = '1.002000'; # 1.2.0
sub import {
my ($class, $path) = @_;
}
}
-sub INTERPOLATE_PATH () { 1 }
-sub LITERAL_PATH () { 0 }
+sub INTERPOLATE_ENV () { 1 }
+sub LITERAL_ENV () { 0 }
sub print_environment_vars_for {
my ($class, $path) = @_;
- my @envs = $class->build_environment_vars_for($path, LITERAL_PATH);
+ my @envs = $class->build_environment_vars_for($path, LITERAL_ENV);
my $out = '';
# rather basic csh detection, goes on the assumption that something won't
sub setup_env_hash_for {
my ($class, $path) = @_;
- my %envs = $class->build_environment_vars_for($path, INTERPOLATE_PATH);
+ my %envs = $class->build_environment_vars_for($path, INTERPOLATE_ENV);
@ENV{keys %envs} = values %envs;
}
PERL5LIB => join(':',
$class->install_base_perl_path($path),
$class->install_base_arch_path($path),
+ ($ENV{PERL5LIB} ?
+ ($interpolate == INTERPOLATE_ENV
+ ? ($ENV{PERL5LIB})
+ : ('$PERL5LIB'))
+ : ())
),
PATH => join(':',
$class->install_base_bin_path($path),
- ($interpolate == INTERPOLATE_PATH
+ ($interpolate == INTERPOLATE_ENV
? $ENV{PATH}
: '$PATH')
),