in reply to array reference as hash key
Why would you want to use an array reference as a hash key? The point of a hash is to have a key to quickly and easily access data in a non-sequential manner. Using an array reference doesn't seem to facilitate that (of course, I'm not sure what you're trying to accomplish). If you want, you can take an array's reference and by using the stringified value as a hash key, you can get a one-to-one mapping, but this really strikes me as something to be avoided without good reason.
So, the question is, what problem are you trying to solve?
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: array reference as hash key
by smgfc (Monk) on Feb 26, 2002 at 02:05 UTC | |
by jeffa (Bishop) on Feb 26, 2002 at 04:52 UTC | |
by smgfc (Monk) on Feb 26, 2002 at 05:00 UTC | |
by rjray (Chaplain) on Feb 26, 2002 at 04:16 UTC | |
|
Re^2: array reference as hash key
by Anonymous Monk on Jun 09, 2011 at 19:49 UTC |