use Data::Dumper; my $ref1 = { foo => 1, bar => 2 }; my $ref2 = { baz => 3, quux => 4 }; # Loop through the keys of the second hash, assigning values into the first $ref1->{$_} = $ref2->{$_} for keys %$ref2; print Dumper $ref1;