producesmy @a1 = qw( A B ); my @a2 = qw( A B C D A D B A C ); foreach my $el(@a1){ my $count = grep /^$el$/, @a2; print "$el is in Array2 $count times\n"; }
A is in Array2 3 times B is in Array2 2 times
In reply to Re: Code requested for array intersection count
by tcf22
in thread Code requested for array intersection count
by harry34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |