Maybe something like this?
our $x = 1; my $f = sub { $x }; { local $x; $x = 2; print $f->(), "\n"; } print $f->(), "\n";
It doesn't give you a way to make my-declared variables local, though.
In reply to Re: Local for lexicals
by mzedeler
in thread Local for lexicals
by JadeNB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |