@sorted=map { $list[$_->[0]] } sort { $a->[1] <=> $b->[1] || $a->[0] <=> $b->[0] } map { [ $_ , func($list[$_]) ] } 0..$#list;