Subject: | Breaks lexical variables shadowed in loops on threaded perls |
When Devel::CallParser is loaded in a threaded perl, lexical variables that are shadowed in a loop end up with a value of undef after the loop ends. Example:
use Devel::CallParser ();
my $f = 1;
print "starting value: $f\n";
while ( 1 ) {
my $f = 2;
last;
}
print "after value: " . ( defined $f ? $f : '[undef]' ) . "\n";
Output:
starting value: 1
after value: [undef]
This happens with for and while loops, but not for bare blocks or ifs. It happens for any code that is compiled after Devel::CallParser is loaded.