use Data::Dumper; my $hash1 = { common_key => 'foo', hash1_specific_key => 'some value' }; my $hash2 = { common_key => 'bar', hash2_specific_key => 'some other value' }; my $joined_keys = [ keys( %{ { map { $_=>undef } keys( %{$hash1} ) , keys( %{$hash2} ) } } ) ]; print Data::Dumper->Dump([$joined_keys],['joined keys']);