A Schwartzian transform is an idiom used to improve the efficiency of sorting a list of items.
my @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, compute($_)] } @unsorted;