Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Using the Variable Name from an Array

by shmem (Chancellor)
on Nov 14, 2019 at 17:13 UTC ( [id://11108683]=note: print w/replies, xml ) Need Help??


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'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (None)
    As of 2024-04-25 01:45 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found