it's possible to use PadWalker::var_name( LEVEL, VAR_REF ) to get the original name of a reference in the callers scope.
Question: can I use the B back-end to achieve the same by calling methods with pure Perl (aka without dependency to a° XS module)?
ehm ... turns out the monastery is my virtual rubber duck
B::Xref is in pure Perl and is capable to inspect the lexicals of a sub. So the answer should be yes, provided I'm able to compare the refs too.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) non-core
In reply to Getting name of a lexical variable without PadWalker? by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |