Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Arrays & Hashes

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


in reply to Arrays & Hashes

Certainly, make the hash values be references to arrays. We call that a HoA.

my %hoa = ( alpha => ['A' .. 'Z','a' .. 'z'], numeric => [0 .. 9], );
You can get at the array elements with multiple indexing: my $char = $hoa{'alpha'}[42]; See perldsc and perllol for more on perl's deeper data structures.

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://484925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found