my %overlap; @overlap{@combo_B} = (); next INNER if first{ exists $overlap{$_} } @combo_A;