in reply to I Ordered My Keys With Existing Values!

Two more options: 1) use both an array and a hash. While I generally eschew such parallel data structures, this might be a good use; 2) add a hash key specifying the order then use that in a loop to print out the values.

I dunno which is better for you. It likely depens on how often you access the "sorted" values and how many hashes you end up having.

HTH, --traveler

  • Comment on Re: I Ordered My Keys With Existing Values!