# externally stored options
my %env_options= qw( cdpath 1 fignore 1 histsize 1 ignoreeof 1
# internally stored options and their defaults
'path' => $Psh::OS
::PATH_SEPARATOR
,
'classpath' => $Psh::OS
::PATH_SEPARATOR
,
'ld_library_path' => $Psh::OS
::PATH_SEPARATOR
,
'fignore' => $Psh::OS
::PATH_SEPARATOR
,
'cdpath' => $Psh::OS
::PATH_SEPARATOR
,
# setup defaults for ENV variables
if (!exists $ENV{HISTSIZE
}) {
if ($env_options{$option}) {
if (@value>1 or (ref $value[0] and ref $value[0] eq 'ARRAY')) {
if ($options{array_exports
} and $options{array_exports
}{$option}) {
$val= join($options{array_exports
}{$option},@value);
if ($env_options{$option}) {
if ($options{array_exports
} and $options{array_exports
}{$option}) {
$val= [split($options{array_exports
}{$option}, $val)];
if (ref $val and ref $val eq 'ARRAY') {
} elsif ( ref $val and ref $val eq 'HASH') {
sub get_printable_option
{
my $tmpval= get_option
($option);
if (ref $tmpval eq 'HASH') {
while (my ($k,$v)= each %$tmpval) {
$val.=" \'".$k."\' => \'".$v."\', ";
$val.=" \'".$k."\' => undef, ";
$val= substr($val,0,-2).' }';
} elsif (ref $tmpval eq 'ARRAY') {
$val= substr($val,0,-2).' ]';
} elsif (ref $tmpval eq 'CODE') {
return 1 if exists $options{$option} or ($env_options{$option} and
exists $ENV{uc($option)});
if ($env_options{$option}) {
delete $ENV{uc($option)};
delete $options{$option};
foreach (keys %env_options) {
push @opts, lc($_) if exists $ENV{uc($_)};