To elaborate further, each sub (and each block?) has hash like structures called "Pads", where closed over variables are referenced.
This Pad is filled at compile time, and eval can only access lexical variables used in this scope.
PadWalker allows to inspect this pad, or the pad of surrounding scopes.
(PadWalker could also be used as a workaround for the OP)
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery
In reply to Re^2: eval in perl package (Pad)
by LanX
in thread [SOLVED]: eval in perl package
by MarcusE
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |