From: Jesse Luehrs Date: Tue, 29 Nov 2011 08:33:24 +0000 (-0600) Subject: simplify this logic a bit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c049a789b0ccb2734ee8c8f1b8a6bb80b575c19b;p=gitmo%2FPackage-Stash.git simplify this logic a bit --- diff --git a/lib/Package/Stash/PP.pm b/lib/Package/Stash/PP.pm index 2796a99..121a57e 100644 --- a/lib/Package/Stash/PP.pm +++ b/lib/Package/Stash/PP.pm @@ -159,9 +159,9 @@ sub add_symbol { } my $namespace = $self->namespace; - my $gv = $namespace->{$name} || Symbol::gensym; - *$gv = ref $initial_value ? $initial_value : \$initial_value; - $namespace->{$name} = *$gv; + $namespace->{$name} ||= *{ Symbol::gensym() }; + *{ $namespace->{$name} } = ref $initial_value + ? $initial_value : \$initial_value; } sub remove_glob {