diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-06-13 11:42:43 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-06-13 11:42:43 -0500 |
commit | a1c10d3a2df2bb969aa0cdca2aeab9ce913d6f88 (patch) | |
tree | 6d62e9d3836c24b63bc470350ca285de820a2bb1 /lib | |
parent | c61010aafbd9317870eeb7f3fd2f1baca88d873c (diff) | |
download | package-stash-a1c10d3a2df2bb969aa0cdca2aeab9ce913d6f88.tar.gz package-stash-a1c10d3a2df2bb969aa0cdca2aeab9ce913d6f88.zip |
stop autovivifying on get
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Package/Stash.pm | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm index 6f0910c..6b95340 100644 --- a/lib/Package/Stash.pm +++ b/lib/Package/Stash.pm @@ -235,22 +235,7 @@ sub get_package_symbol { my $namespace = $self->namespace; if (!exists $namespace->{$name}) { - # assigning to the result of this function like - # @{$stash->get_package_symbol('@ISA')} = @new_ISA - # makes the result not visible until the variable is explicitly - # accessed... in the case of @ISA, this might never happen - # for instance, assigning like that and then calling $obj->isa - # will fail. see t/005-isa.t - if ($type eq 'ARRAY' && $name ne 'ISA') { - $self->add_package_symbol($variable, []); - } - elsif ($type eq 'HASH') { - $self->add_package_symbol($variable, {}); - } - else { - # FIXME - $self->add_package_symbol($variable) - } + $self->add_package_symbol($variable) } my $entry_ref = \$namespace->{$name}; |