http://www.perlmonks.org?node_id=1004453


in reply to Re: Append to hash reference
in thread Append to hash reference

Or...

use Data::Dumper; my $ref1 = { foo => 1, bar => 2 }; my $ref2 = { baz => 3, quux => 4 }; # Use a hash slice to override values from the first hash with the sec +ond hash @$ref1{ keys %$ref2 } = values %$ref2;