in reply to How can I sort a hash of hashes by key in Perl?
See sort. You can pass it a code block that determines how it will sort. Also see perlfaq4 about How do I sort a hash.