http://qs321.pair.com?node_id=1227058


in reply to multiple hash compare, find, create

I don't know how well this would scale on 14MB sets, but this might be a possible solution using Set::Scalar.

Yes, Eily had the most efficient solution. There's no need to create the 3 sets :-(

use Set::Scalar; my %hash_4; my $set_1 = Set::Scalar->new(keys %hash_1); my $set_2 = Set::Scalar->new(keys %hash_2); my $set_3 = Set::Scalar->new(keys %hash_3); my $intersect = $set_1 * $set_2 * $set_3; for my $key (@$intersect) { push @{$hash_4{$key}}, $hash_1{$key}, $hash_2{$key}, $hash_3{$key} +; }