foreach my $i1 (@LongListOfIntegers) { ($i1 & $_)==1 and undef $MatchedIntegers{$i1}{$_} foreach @LongListOfIntegers; }