in reply to Arrays as Hash Values
Then, when you wanted to get the values back, you'd do something like $hash{key1}[2] and that would give you 3.my %hash = ( key1 => [1, 2, 3], key2 => [5, 6, 7], );
The problem with using an arrayref as a hashkey is that the reference gets stringified. That process ends up being divorced from the actual reference, meaning you can't get to it from the key itself.
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Arrays as Hash Values
by c (Hermit) on Aug 16, 2001 at 03:11 UTC | |
by dragonchild (Archbishop) on Aug 16, 2001 at 05:07 UTC | |
by clearcache (Beadle) on Aug 16, 2001 at 10:51 UTC |