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

People
Owner: Nobody in particular
Requestors: sabol [...] alderaan.gsfc.nasa.gov
Cc:
AdminCc:

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



Subject: Subroutines::RequireFinalReturn should allow "throw"
Perl::Critic::Policy::Subroutines::RequireFinalReturn currently requires all subroutines to terminate explicitly with one of the following: "return", "goto", "die", "exit", "carp" or "croak". Missing from the allowed list of subroutine terminators is "throw", as in Error.pm's throw() or Exception::Class's throw(). Please add "throw" to the list of acceptable subroutine terminators. Assuming I'm not missing anything, I believe the patch is fairly trivial, so I'll include it inline here: --- Policy/Subroutines/RequireFinalReturn.pm~ 2007-02-13 14:32:44.000000000 -0500 +++ Policy/Subroutines/RequireFinalReturn.pm 2007-02-17 02:20:54.779590000 -0500 @@ -129,3 +129,3 @@ #----------------------------------------------------------------------------- -my %terminals = hashify( qw(exit die croak confess Carp::confess Carp::croak) ); +my %terminals = hashify( qw(exit die throw croak confess Carp::confess Carp::croak) ); What do you think?
From: THALJEF [...] cpan.org
Will do. Thanks for the patch! -Jeff
This has been fixed in Perl-Critic-1.04 which has just been uploaded to CPAN. Thanks for reporting this! -Jeff