diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-07-10 17:44:47 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-07-10 17:55:30 -0500 |
commit | 7d36752dfb8434954e17524a0f6a5fb68352c1eb (patch) | |
tree | 6b1947103a2c9bd7881da64afe33397646eba499 /lib/Package/Stash/PP.pm | |
parent | df62307a1ff48a0015984903995e4c51b3498c0a (diff) | |
download | package-stash-7d36752dfb8434954e17524a0f6a5fb68352c1eb.tar.gz package-stash-7d36752dfb8434954e17524a0f6a5fb68352c1eb.zip |
vivify globs properly, so they pick up the right magic
Diffstat (limited to 'lib/Package/Stash/PP.pm')
-rw-r--r-- | lib/Package/Stash/PP.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Package/Stash/PP.pm b/lib/Package/Stash/PP.pm index a831564..49cce98 100644 --- a/lib/Package/Stash/PP.pm +++ b/lib/Package/Stash/PP.pm @@ -182,7 +182,15 @@ sub add_symbol { } else { my $namespace = $self->namespace; - $namespace->{$name} ||= *{ Symbol::gensym() }; + { + # using glob aliasing instead of Symbol::gensym, because otherwise, + # magic doesn't get applied properly. + # see <20120710063744.19360.qmail@lists-nntp.develooper.com> on p5p + local *__ANON__:: = $namespace; + no strict 'refs'; + no warnings 'void'; + *{"__ANON__::$name"}; + } if (@_ > 2) { no warnings 'redefine'; |