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?