Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Matching 2 unordered arrays then printing the first array highlighting the matches?

by Anonymous Monk
on Oct 28, 2013 at 21:10 UTC ( #1060065=note: print w/replies, xml ) Need Help??


in reply to Matching 2 unordered arrays then printing the first array highlighting the matches?

Screw all that ... keep it simple. Presumably you are generating a web-page. So, iterate through the first list, and, for each element in the second, use the grep function to look for matching entries to $_. Use a scalar-context since the only thing you care about is whether matching-entries exist. If the result is greater-than-zero, generate the "Match!" string in the second column. Data-volumes in the "thousands of" records frankly do not warrant the use of more-advanced magick.
  • Comment on Re: Matching 2 unordered arrays then printing the first array highlighting the matches?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2023-01-27 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?