$hash{keys %hash} = $_ for delete @hash{sort { $a<=>$b } keys %hash};