Here is the Schwartzian Transform (commonest form)
@data_out = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { [func($_), $_] } @data_in;