Subject: | Reused variable name in lexical scope: $_ |
Variables::ProhibitReusedNames should not include $_ in its check, since
that variable is special and you cannot just 'invent unique variable
names' for it as the message suggests.
Whether lexically-scoped $_ should be used at all is a matter for a
different policy.
Here is a test case which I suggest should not warn:
#!/usr/bin/perl
# $Id: $
use 5.014;
use warnings;
use strict;
our $VERSION = 1;
foreach my $x ( 'a', 'b', 'c' ) {
my $_ = $x;
foreach my $y ( 'x', 'y', 'z' ) {
my $_ = $y;
}
}