Subject: | Grabbing variables is a bit too greedy |
Demonstration:
use strict;
use warnings;
use Lexical::Persistence;
my $environment = Lexical::Persistence->new;
$environment->call(sub {
my $foo = shift;
{ my $abc = 10 };
return $foo;
});
print $environment->get_context('_')->{'$abc'};
See also
http://stackoverflow.com/questions/6275455/re-pl-variable-not-properly-scoped-inside-block