![]() |
|
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?? |
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!
In Section
Seekers of Perl Wisdom
|
|