But you almost certainly shouldn't be doing that, if you really care about the name of your variable pass it as a parameter ie. show('$b',$b);my $a = 'b'; sub show { my $c = shift; print $c . '=' . eval $c; } show('$a');
In reply to Re: Displaying a variable's name and value in a sub
by ciderpunx
in thread Displaying a variable's name and value in a sub
by Smile-n-Nod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |