Look at your sort criteria: { $b->[$col_2sort] <=> $a->[$col_2sort] }. $col_2sort is 2, but that array element does not exist. Change the sort criteria to { $b->[1] <=> $a->[1] } and it works.
You really should be using strict and warnings, using them will help clean up your code.
In reply to Re: Sorting based on any column
by Anonymous Monk
in thread Sorting based on any column
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |