in reply to Tied Hash to emulate double-key hash only accepts one key

(Apparently, my original reply to this got lost in today's site crash...)

I don't think you need to use anything special like a tie or otherwise for this. The hash key can be an array (not an arrayref), which you can use to emulate multi-key'd hashes without the need for any special coding. See my node An interesting oddity with hashes for more details.

my %hash; $hash{ 3,4 } = "array"; $hash{ 3 } = "three"; $hash{ 4 } = "four"; # no collisions!

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Tied Hash to emulate double-key hash only accepts one key
by AidanLee (Chaplain) on Jun 21, 2001 at 22:36 UTC
    A neat trick to be sure. However I need it so that $hash{3,4} and $hash{4,3} result in pulling the same value.