in reply to Count of words that match in an array
my @Array1 = qw( A B C D ); my @Array2 = qw( J C T A ); my $count=0; for ( @Array1 ) { $count++ if $_ ~~ @Array2; } print "Count = $count\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: Count of words that match in an array
by kcott (Archbishop) on Jan 15, 2014 at 09:29 UTC |