in reply to Re^4: how to print out a variable name and its value
in thread how to print out a variable name and its value

Hmmmm.... For me it works. Here a complete program to demonstrate the concept:

use strict; use warnings; my $var1=35; my $var2=undef; foreach my $name ('$var1','$var2') { $_=eval($name); print(defined $_ ? ("$name=[$_]") : "$name is undefined","\n"); }
This prints:
$var1=[35] $var2 is undefined

-- 
Ronald Fischer <ynnor@mm.st>