in reply to How do i sort a hash or array?

Moritz is on the right track. You really need to rethink your data structure. The problems with the current representation is the amount of work it takes to sort (as the second poster related in his code snippets), the array's might get out of sync, etc. Storing them as an Array of Hash's makes more sense and is easier to not only understand but code for.

---
s;;:<).>|\;\;_>?\\^0<|=!]=,|{\$/.'>|<?.|/"&?=#!>%\$|#/\$%{};;y;,'} -/:-@[-`{-};,'}`-{/" -;;s;;$_;see;
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.