http://qs321.pair.com?node_id=888091


in reply to Displaying a variable's name and value in a sub

my $a = 'b'; sub show { my $c = shift; print $c . '=' . eval $c; } show('$a');
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);
--
Linux, perl, punk rock, cider: charlieharvey.org.uk.