in reply to sorting an array of an arrays

This should do the trick:

@courseindex = sort { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] } @courseindex;