my %trans = ('username' => 'Name', 'password' => 'PW'); for my $k (keys %hash1) { $hash2{$trans{$k}} = $hash1{$k} }