my @sorted=map { pop @$_} sort {$a->[0] <=> $b->[0]} map {[some_funky_key_calculator($_),$_]} @objects;