http://qs321.pair.com?node_id=9108

OK - gotta add it, because I can. {grin}

For a complete description of the steps, see my column on sorting.

my @output = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, expensive_func($_)] } @input;