in reply to How do I modify the KEYS in a hash (copy)

Here is another way to modify the keys.

my %Orig=('a b'=>44, 'c d'=>22, rr=>99); my %Copy = map { $_ => $_=~ s/ /_/ } keys %Orig; print qq(C: $_ => $Copy{$_}\n) for keys %Copy;

Originally posted as a Categorized Answer.