Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Array name contained within a string

by Zaxo (Archbishop)
on Jun 20, 2007 at 15:35 UTC ( [id://622284]=note: print w/replies, xml ) Need Help??


in reply to Array name contained within a string

Wrap your data in a hash:

my %list = { list1 => ["one","two","three","four"], list2 => ["four","three","two","one"] ); my $list_ref = $list{$name};
Your intent could also be satisfied with a symbolic reference dereference, but that would be too dirty. Just so you recognise dirt when you see it,
my $list_ref = \@{$name};

After Compline,
Zaxo

Log In?
Username:
Password:

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

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

    No recent polls found