Skip Menu |

This queue is for tickets about the Perl-Critic-PetPeeves-JTRAMMELL CPAN distribution.

Report information
The Basics
Id: 81397
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Perl-Critic-PetPeeves-JTRAMMELL

People
Owner: johntrammell [...] gmail.com
Requestors: MOREGAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.02
Fixed in: (no value)



Subject: false positive in Variables::ProhibitUselessInitialization
echo '( my $sid ) = $f =~ m/pattern/;' | perlcritic -statistics --single Variables::ProhibitUselessInitialization Fatal error while critiquing "SCALAR(0x1f3d9ee8)": Can't call method "isa" on an undefined value at /usr/local/lib/perl5/site_perl/5.10.1/Perl/Critic/Policy/Variables/ProhibitUselessInitialization.pm line 136. but as expected: echo 'my ($sid) = ($f =~ m/pattern/;)' | perlcritic -statistics --single Variables::ProhibitUselessInitialization source OK
I just got this error as well in entirely different code. uniqua:~/list-cycle $ cat isa-bug.pm package List::Cycle; sub new { my $class = shift; my $self = \do { my $scalar }; bless $self, $class; } uniqua:~/list-cycle $ perlcritic -1 -q isa-bug.pm Fatal error while critiquing "isa-bug.pm": Can't call method "isa" on an undefined value at /usr/local/lib/perl5/site_perl/5.12.1/Perl/Critic/Policy/Variables/ProhibitUselessInitialization.pm line 136.
Thanks for the test cases, was able to resolve parsing problem. New version out shortly. Sorry for the delay.