K
kj
With hashes one can use the exists predicate to distinguish between
values that have not been assigned to from those that have been
assigned undef:
my %foo = ( bar => undef );
my $have_bar = exists $foo{ bar }; # true
my $have_baz = exists $foo{ baz }; # false
(Actually, autovivification introduces a wrinkle here, but I don't
want to get into that.)
Is there a way to make the analogous distinction between the case
where a global variable has not been initialized from the one where
it has been explicitly initialized with the value "undef"?
Thanks in advance!
kynn
values that have not been assigned to from those that have been
assigned undef:
my %foo = ( bar => undef );
my $have_bar = exists $foo{ bar }; # true
my $have_baz = exists $foo{ baz }; # false
(Actually, autovivification introduces a wrinkle here, but I don't
want to get into that.)
Is there a way to make the analogous distinction between the case
where a global variable has not been initialized from the one where
it has been explicitly initialized with the value "undef"?
Thanks in advance!
kynn