Subject: | RequireFinalReturn fails to recognize valid return |
We're getting the message Subroutine does not end with "return" on
subroutines that clearly do end in "return;". After some examination,
here is the case that causes the flawed message:
sub f {
foreach my $name qw(John Bill Bob) {
print("$name\n");
}
return;
}
The problem is with the construct "qw(John Bill Bob)". The problem goes
away if you put parens around that. I always thought it a bit odd that
Perl accepts this since I had assumed that surrounding parens would be
required, but Perl doesn't complain and handles it as you would expect.
But it does cause a problem with Perl::Critic.