in reply to sorting columns and getting the largest ansd smallest values in each column

the routine sortSub was taken from Re: How would I sort a two-dimensional array by multiple columns?

And AFAIS the first parameter should be an array-reference of the table.

So IMHO you could change sortSub(@colArray, 0, 1, 3); to sortSub(\@colArray, 0, 1, 3);.

Cheers Rolf