in reply to check all elements of an array against another array...
So it sounds like you want the intersection of two arrays - see for example How can I find the union/difference/intersection of two arrays?. In the first example there, you can get your count via my $count = @female_simpsons;, or more directly by my $count = grep ... - note however this might not be the best approach if your arrays are large because it will consume quite a bit of memory.
|
|---|