in reply to Sort a two-dimensional array?
In your sort, $a and $b are references to arrays. To access the first row (row 0) you need to dereference the arrays first. Change $a and $b to ${$a}[0] and ${$b}[0] in your sort routine.
-- dempa