in reply to Order hash results

A hash table look-up is the fastest "complex" data structure on the planet, BUT you give up sequential access. Here you know the keys so that doesn't matter. If you do want N things, then you do N queries. I see no easier way. There is a syntax to get both the key and value at once, but "at the end of the day", it does N queries.

If this func is going to be in a sub, then push onto a reference to array instead of returning @result from the sub(). That will be significantly faster.