in reply to sorting with Schwartzian Transform
Where $idx is the column number you care about. If @array contains newlines, that might spew warnings... try@sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split /[,.]/, $_)[$idx] ] } @array;
map { chomp(my $key = (split /[,.]/, $_)[$idx]); [ $_, $key ] } @array;
|
|---|