Login
Handle the __PACKAGE__->_foo() case in ProtectPrivateSubs.
authorElliot Shank <perl@galumph.com>
Sat, 11 Oct 2008 02:41:20 +0000 (02:41 +0000)
committerElliot Shank <perl@galumph.com>
Sat, 11 Oct 2008 02:41:20 +0000 (02:41 +0000)
lib/Perl/Critic/Policy/Subroutines/ProtectPrivateSubs.pm

index 1da5e50..88d5e9c 100644 (file)
@@ -70,7 +70,7 @@ sub _is_other_pkg_private_method {
     # sometimes the previous sib is a keyword, as in:
     # shift->_private_method();  This is typically used as
     # shorthand for "my $self=shift; $self->_private_method()"
-    $pkg ne 'shift' || return;
+    return if $pkg eq 'shift' or $pkg eq '__PACKAGE__';
 
     return 1;
 }