Splits it into environment_vars_string_for() to generate the string and
leaves print_environment_vars_for() as just a print wrapper around it.
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