Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Count of words that match in an array

by simmisam (Novice)
on Jan 15, 2014 at 07:10 UTC ( #1070655=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1070655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-08-16 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?