Just for anyone else... here's a good example from DaveC. That's a good start for figuring out how to do any kind of sorting of a hash table.