my @keys_in_commmon = grep $hashref1->{$_}, keys %$hashref2; #### if( grep $hashref1->{$_}, keys %$hashref2 ) { ... }