in reply to Local for lexicals
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Local for lexicals
by JadeNB (Chaplain) on Aug 10, 2009 at 15:44 UTC |