summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-11-29 10:19:19 +0000
committerNicholas Clark <nick@ccl4.org>2006-11-29 10:19:19 +0000
commit39c882dbc98f9882c1734a8ce9110ac8b59b2741 (patch)
tree6a65cdcb18d983402d985cbd40139b41d23e7b89 /lib
parent5624f11d89c15fde037a59d42ad53114f8b91abd (diff)
downloadperl-39c882dbc98f9882c1734a8ce9110ac8b59b2741.tar.gz
Fix Attribute::Handlers to cope with proxy constant subroutines.
p4raw-id: //depot/perl@29414
Diffstat (limited to 'lib')
-rw-r--r--lib/Attribute/Handlers.pm1
-rw-r--r--lib/Attribute/Handlers/t/constants.t13
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Attribute/Handlers.pm b/lib/Attribute/Handlers.pm
index 35484be426..6bd121b64d 100644
--- a/lib/Attribute/Handlers.pm
+++ b/lib/Attribute/Handlers.pm
@@ -16,6 +16,7 @@ sub findsym {
no strict 'refs';
foreach my $sym ( values %{$pkg."::"} ) {
use strict;
+ next unless ref ( \$sym ) eq 'GLOB';
return $symcache{$pkg,$ref} = \$sym
if *{$sym}{$type} && *{$sym}{$type} == $ref;
}
diff --git a/lib/Attribute/Handlers/t/constants.t b/lib/Attribute/Handlers/t/constants.t
new file mode 100644
index 0000000000..746a87e0ec
--- /dev/null
+++ b/lib/Attribute/Handlers/t/constants.t
@@ -0,0 +1,13 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ }
+}
+use strict;
+use Test::More tests => 1;
+use Attribute::Handlers;
+# This had been failing since the introduction of proxy constant subroutines
+use constant SETUP => undef;
+sub Test : ATTR(CODE) { };
+ok(1, "If we got here, CHECK didn't fail");