http://www.perlmonks.org?node_id=49288


in reply to Schwartzian Transform

You probably meant @temp = sort { $a->[0] <=> $b->[0] } @temp;

Although, given a @temp array, it benchmarks faster to do
@temp = map { length $_ } @strings; @sorted = @strings[sort{$temp[$a]<=>$temp[$b]} $[..$#temp];