in reply to Specify Output of Keys in Hash
So... What is your rule to determine the desired sort order? If it's not insertion order, then you might decide to just sort the keys. See the FAQ: How do I sort a hash (optionally by value instead of key)?