Subject: | Warning if same lexical name used twice |
The following script reports a unused warning where IMHO it shouldn't:
#!/usr/bin/perl
use warnings::unused;
use warnings 'once';
for my $foo (1,2,3) {
my $foo = $foo;
$foo = "-$foo-";
warn $foo;
}
__END__
Output is:
...
Unused variable my $foo at /tmp/a.pl line 6.
Just changing one of the both $foo's to some other name workarounds the
problem.
Regards,
Slaven