Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Kenosis (Priest)
on Oct 28, 2013 at 19:19 UTC ( #1060042=note: print w/replies, xml ) Need Help??


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

Consider using the Module List::Compare to obtain the two lists' intersection, then place that intersection into a hash. When you iterate through the first array, check whether there's a key for each element of that array. If there's a key, it's a common element, so 'highlight' it, else leave it 'unhighlighted.'

Hope this helps!

  • 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://1060042]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2023-01-28 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?