Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Answer: How do I make a hash of arrays?

( #179957=categorized answer: print w/ replies, xml ) Need Help??

Q&A > Data Structures > How do I make a hash of arrays? contributed by Anonymous Monk

my @arrayOne = 1..10; my @arrayTwo = 20..30; my %HashOfArrays = ( one => \@arrayOne ); $HashOfArrays{two} = \@arrayTwo; $HashOfArrays{IpointToTheSameArrayAsOne} = \@arrayOne ; $HashOfArrays{IreferenceTheSameArrayAsOne} = \@arrayOne ; $HashOfArrays{MyValueIsThatOfOneAsWell} = \@arrayOne ;
## to create an array reference, just type \@array
## or [ @array ]
##  [ @array ] does not equal \@array
## see perlref for more info

Comment on Answer: How do I make a hash of arrays?
Select or Download Code
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2016-02-13 03:29 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (417 votes), past polls