On Thu Apr 15 07:24:42 2010, JARIAALTO wrote:
Show quoted text> Too many arguments at line 4, column 1. See page 182 of PBP.
>
> 1 #!/usr/bin/perl
> 2 use strict;
> 3
> 4 sub test ( $ ; $ )
> 5 {
> 6 1;
> 7 }
>
> the prototype definition is valid.
This looks like a real Perl::Critic bug to me. The question is not
whether the prototype is valid, it is how many arguments it specifies.
The right answer is 2, but the code was computing the number of
arguments as the length of the prototype string minus 2 for the
parentheses. This is wrong not only because of embedded spaces, but
because of the semicolon, possible back slashes and square brackets, and
so on (see perlsub).
Proposed fix committed as revision 3798. I even remembered to update
Changes (and there was great rejoicing.)