Subject: | warning about used variable in certain nest and shadow |
Date: | Fri, 12 Dec 2008 08:05:41 +1100 |
To: | bug-warnings-unused [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With warnings::unused 0.021 and the debian perl 5.10.0 the program below
prints
Unused variable my @x at foo.pl line 6.
whereas I believe that variable is in fact used.
For what it's worth it seems to be related to having another @x in the
sub-block and then the only uses of the toplevel @x being within a
further, separate, subblock at the same nesting level.
package main;
use strict;
use warnings;
use warnings::unused;
my @x;
{
my @x = ("one\n");
print $x[0];
}
{
$x[0] = "two\n";
print $x[0];
}