Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Arrays & Hashes

by Zaxo (Archbishop)
on Aug 18, 2005 at 18:51 UTC ( #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
Node Status?
node history
Node Type: note [id://484925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2020-06-06 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (41 votes). Check out past polls.

    Notices?