Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: storing variable names in an array

by dReKurCe (Scribe)
on Jun 11, 2005 at 21:42 UTC ( [id://465854]=note: print w/replies, xml ) Need Help??


in reply to storing variable names in an array

Greetings:
The following code uses refs to access the scalar variables:
our $file1 ="tom"; our $file2 = "bob"; our $file3 = "joe"; my @names =( "file1", "file2", "file3" ); $ref=\@names; $file=$ref->[0]; print ${$file};

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found