It sounds like you've already considered and discarded this, but I'll suggest it anyway: IxHash.
But a couple of other options that you didn't mention are:
my $pseudo_hash = [ { a => 1, b => 2, c => 3 }, 'A', 'B', 'C' ]; print $pseudo_hash->{b}; # prints 'B' print $pseudo_hash->[2]; # prints 'B' print $pseudo_hash->[$pseudo_hash->[0]->{b}]; # prints 'B'
Update: at jdporter's suggestion above, I installed and took a look at IxHash. Interestingly, it's implemented as a synthesis of a pseudo-hash and an associative array. The first element of the array is the hash for key/index mappings, and the two subsequent entries in the array are arrays for the keys and data themselves.
In reply to Re: Hashes made to order
by djantzen
in thread Hashes made to order
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |