for a debugging-sub I would like to pass the name of a variable to the sub. How is this possible?
my $x; yoursub '$x';
Inside your sub you can use PadWalker to access foreign lexical variables, and caller plus symbol table magic for package variables.
In reply to Re: passing a variables name to a subroutine
by moritz
in thread passing a variables name to a subroutine
by LANTI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |