Perl-Sensitive Sunglasses | |
PerlMonks |
Re^5: Indirect variable nameby moritz (Cardinal) |
on Nov 21, 2008 at 07:18 UTC ( [id://725063]=note: print w/replies, xml ) | Need Help?? |
sorry I don't understand this argumentation, if you want to make a symderef on a lexical you can always use eval Not if a closure didn't include that variable:
Whoops. Perl knows at compile time which lexicals in outer scopes are needed for a closure, and only stores those. With the current current behaviour only eval can be used to detect that. That's OK because eval has the "evil, don't use" stigma on it. If symbolic deref would also look in lexicals, every deref might break this optimization. I hope it's a bit clearer now.
In Section
Seekers of Perl Wisdom
|
|