use strict; use warnings; my $n="outer"; my $f; { my $n="ok"; $f=sub { eval "".shift }; check(); # "ok" }; sub check { print $f->('$n') } print $n; # "outer" exit;
Cheers Rolf
In reply to Re^3: Accessing lexicals in other scopes dynamically by name
by LanX
in thread Accessing lexicals in other scopes dynamically by name
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |