The PerlCritic output does not include the page references to the Perl Best Practices book. I’ve tried altering the verbosity settings in the .perlcriticrc file, but that did not help. I verified the config file is being used by adding some exclusions and it used those.
Here is a sample of the output I am getting in the “Syntax Checking Status” area for “Description”:
Always unpack @_ first
Here is what I get from the command line (by default with no verbose param):
Always unpack @_ first at line 28, column 1. See page 178 of PBP. (Severity: 4)
That is immensely more useful as I can immediately look up sections that are unfamiliar to me.
Is there some way to increase the verbose level of this output? I am hoping that I am just missing a param or preference somewhere.
Continuing this theme, it would be awesome if you could expand the message to see the full verbose output, which actually has a more detailed explanation:
Subroutines::RequireArgUnpacking (Severity: 4)
Subroutines that use `@_' directly instead of unpacking the arguments to
local variables first have two major problems. First, they are very hard
to read. If you're going to refer to your variables by number instead of
by name, you may as well be writing assembler code! Second, `@_'
contains aliases to the original variables! If you modify the contents
of a `@_' entry, then you are modifying the variable outside of your
subroutine. For example:
sub print_local_var_plus_one {
my ($var) = @_;
print ++$var;
}
sub print_var_plus_one {
print ++$_[0];
}
my $x = 2;
print_local_var_plus_one($x); # prints "3", $x is still 2
print_var_plus_one($x); # prints "3", $x is now 3 !
print $x; # prints "3"
This is spooky action-at-a-distance and is very hard to debug if it's
not intentional and well-documented (like `chop' or `chomp').
An exception is made for the usual delegation idiom
`$object->SUPER::something( @_ )'. Only `SUPER::' and `NEXT::' are
recognized (though this is configurable) and the argument list for the
delegate must consist only of `( @_ )'.
Any insight into this would be very helpful for me and my team.
Thanks so much!
P.S.
Komodo IDE, version 8.5.3, build 83298, platform macosx.
Built on Mon Nov 18 17:03:31 2013.