in reply to Displaying a variable's name and value in a sub
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');
|
|---|