diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-06 13:09:05 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 06:19:32 -0700 |
commit | 7a11f5c382a3ea35768e2f50d7dbeaed6adc2398 (patch) | |
tree | 85622e0a5ab7fcfa4d18a544f42861b9e9c639e5 /dist | |
parent | 44b2d6d61b5b1b85de1be347091e97d57de8ae0c (diff) | |
download | perl-7a11f5c382a3ea35768e2f50d7dbeaed6adc2398.tar.gz |
Fix-ups for Attribute::Handlers
It was making unreliable assumptions about the contents of stashes.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/Attribute-Handlers/lib/Attribute/Handlers.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dist/Attribute-Handlers/lib/Attribute/Handlers.pm b/dist/Attribute-Handlers/lib/Attribute/Handlers.pm index 4ae65d9edb..a0b4af9885 100644 --- a/dist/Attribute-Handlers/lib/Attribute/Handlers.pm +++ b/dist/Attribute-Handlers/lib/Attribute/Handlers.pm @@ -13,12 +13,16 @@ sub findsym { return $symcache{$pkg,$ref} if $symcache{$pkg,$ref}; $type ||= ref($ref); no strict 'refs'; - foreach my $sym ( values %{$pkg."::"} ) { + my $symtab = \%{$pkg."::"}; + for ( keys %$symtab ) { for my $sym ( $$symtab{$_} ) { + if (ref $sym && $sym == $ref) { + return $symcache{$pkg,$ref} = \*{"$pkg:\:$_"}; + } use strict; next unless ref ( \$sym ) eq 'GLOB'; return $symcache{$pkg,$ref} = \$sym if *{$sym}{$type} && *{$sym}{$type} == $ref; - } + }} } my %validtype = ( |