for my $ctrl_2 ( sort { $b <=> $a } keys (%final) ){ ... }