use warnings; use strict; use Data::Dumper; my $num_hashes = 3; my %h1 = ( a => 1, b => 2, c => 3, ); my %h2 = ( a => 4, b => 5, d => 10, ); my %h3 = ( x => 20, p => 15, b => 6, a => 12, ); my %key_list; for my $hash (\%h1, \%h2, \%h3){ $key_list{$_}++ for keys %$hash; } my %combined; for my $hash (\%h1, \%h2, \%h3){ for (keys %key_list){ next if $key_list{$_} < $num_hashes; push @{ $combined{$_} }, $hash->{$_}; } } print Dumper \%combined; #### $VAR1 = { 'b' => [ 2, 5, 6 ], 'a' => [ 1, 4, 12 ] };