in reply to Re^2: Accessing lexicals in other scopes dynamically by name
in thread Accessing lexicals in other scopes dynamically by name

Some changes to your code to make it clearer!

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