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: 41734
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: ProhibitUnreachableCode on "package" statement
Date: Tue, 16 Dec 2008 10:36:48 +1100
To: bug-perl-critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With perlcritic 1.092 and a recent debian perl 5.10.0, the foo.pl below criticized as perlcritic --single-policy=ProhibitUnreachableCode foo.pl gives Unreachable code at line 4, column 1. Consider removing it. (Severity: 4) whereas I hoped the "package" statement there would be ok after an exit().
Foo::foo(); exit 0; package Foo; sub foo { print "hello\n"; }
--- ProhibitUnreachableCode.pm.old 2008-12-13 15:14:32.000000000 +1100 +++ ProhibitUnreachableCode.pm 2008-12-13 15:18:18.000000000 +1100 @@ -76,6 +76,7 @@ next if $stmnt->isa('PPI::Statement::Sub'); next if $stmnt->isa('PPI::Statement::End'); next if $stmnt->isa('PPI::Statement::Data'); + next if $stmnt->isa('PPI::Statement::Package'); next if $stmnt->isa('PPI::Statement::Include') && $stmnt->type() ne 'require';
Subject: Re: [rt.cpan.org #41734] ProhibitUnreachableCode on "package" statement
Date: Mon, 15 Dec 2008 20:09:16 -0600
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Applied. Thank you.
This has been released as http://search.cpan.org/~elliotjs/Perl-Critic-1.094001/ Cheers. -Jeff