Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 61311
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: rjray [...] blackperl.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 1.109
  • 1.111
Fixed in:
  • 1.110_001
  • 1.112_001
  • 1.113



Subject: Subroutines::ProhibitUnusedPrivateSubroutines dies on "&_name" call
Attached file is a minimal instance that triggers the bug. If a "private" subroutine is called with a sigil, the following error is thrown: Can't call method "isa" without a package or object reference at /usr/local/share/perl/5.10.0/Perl/Critic/Policy/Subroutines/ProhibitUnusedPrivateSubroutines.pm line 196 I have tested and established that "&_name()" is the triggering syntax. "_name()" does not trigger it, nor does "&name()". Randy -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Randy J. Ray Silicon Valley Scale Modelers: http://www.svsm.org rjray@blackperl.com randy.j.ray@gmail.com
Subject: critic_bug
Download critic_bug
application/octet-stream 136b

Message body not shown because it is not plain text.

Thanks for the report, and for the work done to isolate the problem. The fix has been committed as SVN revision 3922. The problem was that the return value of sprevious_sibling() was being incorrectly tested. About 12 lines into sub _find_sub_reference_in_document(), and again about 18 lines in, the code 'defined $prior' occurs. The 'defined' should be removed; that is, the code should just be '$prior'. The erroneous code assumed that the PPI method sprevious_sibling() returned undef if there was no previous sibling in the parse tree. In fact, it is documented as returning a false value.
I recently upgraded to 1.111, which should have had this fixed, but I got the same problem. Did the patch not make it from the dev release into 1.111? I have had to alter lines 196 and 202 in ProhibitUnusedPrivateSubroutines.pm in order to get my tools to work. Randy -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Randy J. Ray Silicon Valley Scale Modelers: http://www.svsm.org rjray@blackperl.com randy.j.ray@gmail.com
On Tue Jan 04 14:48:18 2011, RJRAY wrote: Show quoted text
> I recently upgraded to 1.111, which should have had this fixed, but I > got the same problem. Did the patch not make it from the dev release > into 1.111? I have had to alter lines 196 and 202 in > ProhibitUnusedPrivateSubroutines.pm in order to get my tools to work. > > Randy
1.111 was an emergency release to deal with the fact that List::MoreUtils 0.30 broke Perl::Critic. It is not the successor to 1.110_001. The successor to 1.110_001 is 1.111_001, which will become a production release sometime in the future. But there does not seem to be a good way to say that with version numbers. Maybe creative use of the "broken in" and "fixed in" RT fields could convey this at least to the people with an interest in the tickets involved. Tom
Correction: s/1.111_001/1.112_001/