# update hash1 with the stuff in hash2 foreach my $key (keys %hash2) { $hash1{$key} = $hash2{$key}; }