summaryrefslogtreecommitdiffstats
path: root/lib/Stash/Manip.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Stash/Manip.pm')
-rw-r--r--lib/Stash/Manip.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Stash/Manip.pm b/lib/Stash/Manip.pm
index 3b9bcff..38177c7 100644
--- a/lib/Stash/Manip.pm
+++ b/lib/Stash/Manip.pm
@@ -184,8 +184,12 @@ sub get_package_symbol {
my $namespace = $self->namespace;
# FIXME
- $self->add_package_symbol($variable)
- unless exists $namespace->{$name};
+ if (!exists $namespace->{$name}) {
+ my $initial = $type eq 'ARRAY' ? []
+ : $type eq 'HASH' ? {}
+ : \undef;
+ $self->add_package_symbol($variable, $initial)
+ }
my $entry_ref = \$namespace->{$name};