From a1c10d3a2df2bb969aa0cdca2aeab9ce913d6f88 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 13 Jun 2010 11:42:43 -0500 Subject: stop autovivifying on get --- lib/Package/Stash.pm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'lib/Package/Stash.pm') 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}; -- cgit v1.2.3-54-g00ecf