You're right, I meant value.
Specifically, I don't understand what you mean by "You are mistaken in your belief that lexical variables get deallocated at the end of their scope." When a variable goes "out of scope", I thought it meant both the value it referred to and that specific variable name were no longer available to the program. Put another way:
if($x)
{
my $y;
...
}
$y ...
The second $y has nothing to do with the one inside the 'if'. Outside of the 'if', I have no way to get to the 'inside the if' $y or its value. At least, that was my understanding. So, I've been doing things like:
use strict;
my $c = 0;
while(<>)
{
chomp;
$c++;
my $a;
print "1: $a iteration $c\n" if $a;
$a = $_;
print "2: $a iteration $c\n" if $a;
}
And expecting that, every time around the loop, the value for $a from any prior loop would have been forgotten. Which means the first 'print' would never run. What you're saying makes me think this is not true, even though experience shows it works. Therefore, there's something about what you said that I'm not understanding.
I'm also not at all familiar with 'Devel::Peek' and have no idea how to interpret the output you supplied, which just adds to the confusion. |