diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-05-12 00:35:25 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-05-12 00:35:25 -0500 |
commit | a2a2164aadab29b7424ea8f581413cf6a3b185b1 (patch) | |
tree | 3bc52a86c1440bae8bfafd07d3ecf2485e54dd15 /lib | |
parent | b133cc4fa17cc6144c765df77050d5a9a9f3cb3c (diff) | |
download | package-stash-a2a2164aadab29b7424ea8f581413cf6a3b185b1.tar.gz package-stash-a2a2164aadab29b7424ea8f581413cf6a3b185b1.zip |
only pass initializers for array and hash
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Stash/Manip.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Stash/Manip.pm b/lib/Stash/Manip.pm index 3055d1d..173ba13 100644 --- a/lib/Stash/Manip.pm +++ b/lib/Stash/Manip.pm @@ -204,12 +204,17 @@ sub get_package_symbol { my $namespace = $self->namespace; - # FIXME if (!exists $namespace->{$name}) { - my $initial = $type eq 'ARRAY' ? [] - : $type eq 'HASH' ? {} - : \undef; - $self->add_package_symbol($variable, $initial) + if ($type eq 'ARRAY') { + $self->add_package_symbol($variable, []); + } + elsif ($type eq 'HASH') { + $self->add_package_symbol($variable, {}); + } + else { + # FIXME + $self->add_package_symbol($variable) + } } my $entry_ref = \$namespace->{$name}; |