props has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I know a lexical resides in its enclosed block,
this is a definite closure
why this is not a closure though ?my $total_size =0; find{ sub $total_size += -s if -f}, '.'); print $total_size, "\n";
in my eyes my $a is visible outside the {} many thanksuse warnings; use strict; { my $a; } $a=1 print $a;
Back to
Seekers of Perl Wisdom