in reply to Re^3: Reformat Text File
in thread Reformat Text File

I presume the problem has been simplified from an original case with meaningful keys in some meaningful order. Say the keys were dates in some odd format:
July 21,Milestone meeting August 3,First walkthrough August 3,Committee meeting September 12,Second walkthrough
merlyn puts all the values into a hash and then does a straight sort on the keys. That would make "August 3" come before "July 21" in my example. Rather than work out a fancy sorting routine for dates (or whatever the keys might be), my example maintains the original order of the first appearance of each key.