in reply to Sorting an array of hashes

You should look into XML::Simple for turning your keys around. Much more convenient, much less work.