Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Count of words that match in an array

by Russ (Deacon)
on May 10, 2002 at 03:23 UTC ( [id://165587]=note: print w/replies, xml ) Need Help??


in reply to Count of words that match in an array

This is not necesarily the most CPU efficient way...
# Turn at least one of the arrays into a hash (hashes are perfect for +this kind of thing) @Hash1{"A", "B", "C", "D"} = undef; # Then, just use exists... print scalar grep {exists $Hash1{$_}} ("J", "C", "T", "A");

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 23:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found