Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Answer: How do I make a hash of arrays?

by Anonymous Monk
on Jul 07, 2002 at 11:49 UTC ( #179957=categorized answer: print w/replies, xml ) Need Help??

Q&A > Data Structures > How do I make a hash of arrays? - Answer 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

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 having an uproarious good time at the Monastery: (11)
As of 2016-10-28 17:37 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (386 votes). Check out past polls.