http://qs321.pair.com?node_id=268566


in reply to Sorting hash keys according to different criteria

If they are coming in in the order that you need them, consider Tie::IxHash to keep the hash keys in the order of assignment.

Or, just have an array with the 12 months in it, and use that rather than sorting the keys. Skip over the elements that don't exist.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.