summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-06 13:09:05 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-15 06:19:32 -0700
commit7a11f5c382a3ea35768e2f50d7dbeaed6adc2398 (patch)
tree85622e0a5ab7fcfa4d18a544f42861b9e9c639e5
parent44b2d6d61b5b1b85de1be347091e97d57de8ae0c (diff)
downloadperl-7a11f5c382a3ea35768e2f50d7dbeaed6adc2398.tar.gz
Fix-ups for Attribute::Handlers
It was making unreliable assumptions about the contents of stashes.
-rw-r--r--dist/Attribute-Handlers/lib/Attribute/Handlers.pm8
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 = (