Skip Menu |

This queue is for tickets about the Class-Sniff CPAN distribution.

Report information
The Basics
Id: 72158
Status: resolved
Priority: 0/
Queue: Class-Sniff

People
Owner: NEILB [...] cpan.org
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc: perl5-porters [...] perl.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.09_01



CC: perl5-porters [...] perl.org
Subject: Bleadperl f132ae69 breaks Class::Sniff
A change in perl 5.6.0 inadvertently caused perl to be inconsistent with regard to *{$undef}. Before that, *{$undef} would always die with ‘Can’t use an undefined value...’. In 5.6.0, it would only *usually* do that. If the undefined happened to be the one returned by the ‘undef’ operator, which is also returned by other operations such as nonexistent hash elements, it would be treated as *{""}. I fixed this inconsistency in bleadperl with commit f132ae69, restoring the pre-5.6 behaviour, but it breaks your module. I hope you will agree that this is a bug. Attached is a patch to Class::Sniff. I used a separate $stash variable for speed.
Subject: open_xb9i4qE9.txt
diff -rup Class-Sniff-0.09-68kpJC-orig/lib/Class/Sniff.pm Class-Sniff-0.09-68kpJC/lib/Class/Sniff.pm --- Class-Sniff-0.09-68kpJC-orig/lib/Class/Sniff.pm 2011-11-03 17:57:14.000000000 -0700 +++ Class-Sniff-0.09-68kpJC/lib/Class/Sniff.pm 2011-11-03 18:01:31.000000000 -0700 @@ -1128,8 +1128,9 @@ sub _is_real_package { return 1 if 'UNIVERSAL' eq $class; return unless eval { - defined *{ ${"${class}::"}{ISA} }{ARRAY} - || scalar grep { defined *{$_}{CODE} } values %{"$class\::"}; + my $stash = \%{"$class\::"}; + defined $stash->{ISA} && defined *{ $stash->{ISA} }{ARRAY} + || scalar grep { defined *{$_}{CODE} } values %$stash; }; }
The problem still persists with perl 5.16.0 RC0. Regards, Slaven
On 2012-05-13 09:30:29, SREZIC wrote: Show quoted text
> The problem still persists with perl 5.16.0 RC0.
The problem is still there with perl 5.18.x and 5.20.x.
Thanks -- fixed in 0.10 Neil