foreach ( sort keys %h ) { ... $h{$new} = $new;