use Data::Dumper; my $ref1 = { foo => 1, bar => 2 }; my $ref2 = { baz => 3, quux => 4 }; # Assign to the ref1 hash the data in both hashes %$ref1 = (%$ref1, %$ref2); print Dumper $ref1;