use strict; use warnings; use Data::Dumper; my $ref1= { ref1_specific_key => 'some value', common_key => { common_subkey => 'foo' } }; my $ref2= { ref2_specific_key => 'some other value', common_key => { common_subkey => 'bar' } }; my $output = { %$ref1, %$ref2 }; print Dumper $output;