I'm a little hesitant to offer an answer because I'm not sure what you mean, but I'll
give it a shot so that you have a chance to clarify if I'm way off. It's possible
that what you want is a hash of arrays, where each hash key points to a different
array. If so, then what you would want would be something like this:
my %hash = ( firstarray => ["this","is","my","list"],
nextarray => ["this","is","another","list"] );
print $hash{firstarray}->[2]; #prints "my"
print $hash{firstarray}->[3]; #prints "list"
Note: the [] brackets indicate an anonymous array. What I've done above is create an
anonymous array and add a reference to it as the value to the firstarray and then
nextarray keys. You can then use the syntax above to access the values or dereference
the array, like so: @{$hash{firstarray}} if you wanted to use sort(), shift(), etc.
-----Original Message-----
From: gohaku [mailto:[EMAIL PROTECTED]
Sent: Sat 6/19/2004 10:04 PM
To: Perl Beginners
Cc:
Subject: Adding Arrays as Hash Keys
Hello everyone,
I would like to know if there is a cleaner way of Merging Hash Keys
with Arrays