in reply to Re: Re: Re: hash 2 array ?
in thread hash 2 array ?

Eh... I added a packed ordinal number to the value of each hash entry. Doesn't have anything to do with keys. And yes, you will have a runtime hit, but only if you need to sort (when you need the ordinal number) and/or obtain the (real) value of the hash entry.

Again, my solution optimizes for memory usage. Not CPU. YMMV.

With regards to Tie::IxHash: that's a fine module, but may be doing (a lot) more than you want. And don't forget the inherit CPU hit for using a tied hash. Finally, TIMTOWTDI. ;-)

Liz