in reply to Re^2: Accessing lexicals in other scopes dynamically by name
in thread Accessing lexicals in other scopes dynamically by name
Consider:
use strict; { my $a = \$a; print "a=$a\n"; sub f { my $var = shift; print $var, "=", eval "\$$var", "\n"; }; } &f("a");
$a references itself, so it will never be garbage-collected, yet it is not accessible in the eval.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Accessing lexicals in other scopes dynamically by name
by LanX (Saint) on Jul 30, 2010 at 20:52 UTC |