$output[$_][$c] = $x++ for sort { $input[$b][$c] <=> $input[$a][$c] } 0 .. $#input;