Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Arrays & Hashes

by Transient (Hermit)
on Aug 18, 2005 at 18:51 UTC ( [id://484924]=note: print w/replies, xml ) Need Help??


in reply to Arrays & Hashes

No, but you can create a hash of array refs...

see perlref and perlreftut.

Here's an example:
my $hash_of_arrays = { array1 => [ 1, 2, 3 ], array2 => [ 'a', 'b', 'c' ] }; foreach my $key ( %$hash_of_arrays ) { print "Key: $key\n"; foreach my $array_element ( @$key ) { print "Array Element: $array_element\n"; } }
(Untested)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found