in reply to Matching 2 unordered arrays then printing the first array highlighting the matches?
Dear DT --
First method (non-Perl):
- sort fileA and write it to /tmp
- sort fileB and write it to /tmp
- Use cmp or diff to detect the differences between the two /tmp files and report.
- read fileA and use each value as a hash-key with a hash-value of 1 ($seen_hash{$valueA} = 1;)
- read fileB and use each value as a hash-key and add a value of 2 ($seen_hash{$valueB} += 2;)
- Read through the hash and report on all keys where the value is '3'.
----
I Go Back to Sleep, Now.
OGB
In Section
Seekers of Perl Wisdom