in reply to Sorting based on any column
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.
|
|---|