You probably don't need to do this ever, but you can if you install PadWalker:
use Modern::Perl; use PadWalker 'var_name'; sub show1 { my $name = var_name(1, \$_[0]); say "show1 called with $name"; }
In reply to Re: Displaying a variable's name and value in a sub
by chromatic
in thread Displaying a variable's name and value in a sub
by Smile-n-Nod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |