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


in reply to Re^2: Using the Variable Name from an Array
in thread Using the Variable Name from an Array

Getting @ the variable_name inside of the array is what I can not remember how to do.

You don't have a variable_name inside of the array available by assignment. You have the values of the variables.

If you want to access the values by name, do so using a hash:

$test =12; $test2 =13; %hash=( test => $test, test2 => $test2, ); foreach $name(qw(test test2)) { print "$name $hash{$name}\n"; }
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'