use Carp ();
use Config;
-our $VERSION = '1.007000'; # 1.7.0
+our $VERSION = '1.008001'; # 1.8.1
our @KNOWN_FLAGS = qw(--self-contained);
sub print_environment_vars_for {
my ($class, $path) = @_;
+ print $class->environment_vars_string_for($path);
+}
+
+sub environment_vars_string_for {
+ my ($class, $path) = @_;
my @envs = $class->build_environment_vars_for($path, LITERAL_ENV);
my $out = '';
$value =~ s/(\\")/\\$1/g;
$out .= $class->${\"build_${shelltype}_env_declaration"}($name, $value);
}
- print $out;
+ return $out;
}
# simple routines that take two arguments: an %ENV key and a value. return
sub build_environment_vars_for {
my ($class, $path, $interpolate) = @_;
return (
- PERL_LOCAL_LIB_ROOT => $path,
+ PERL_LOCAL_LIB_ROOT => join($Config{path_sep},
+ (($ENV{PERL_LOCAL_LIB_ROOT}||()) ?
+ ($interpolate == INTERPOLATE_ENV
+ ? ($ENV{PERL_LOCAL_LIB_ROOT}||())
+ : (($^O ne 'MSWin32') ? '$PERL_LOCAL_LIB_ROOT'
+ : '%PERL_LOCAL_LIB_ROOT%' ))
+ : ()),
+ $path
+ ),
PERL_MB_OPT => "--install_base ${path}",
PERL_MM_OPT => "INSTALL_BASE=${path}",
PERL5LIB => join($Config{path_sep},