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


in reply to Common hash keys

use strict; use vars qw($hashRef1 $hashRef2); #code that puts values into the hashes my @keyIntersection = grep exists($hashRef2->{$_}), keys %$hashRef1; # Or if you just want to know if there are any use List::Util; my $hasInt = first {exists $hashRef2->{$_}} keys %$hashRef1;
$hasInt will be undef unless there's an intersection.
But be careful, it will be 0 if the first interecting key is '0'

throop