In Chapter 4, Section 4.8 (Computing Union, Intersection, or Difference Unique Lists), the Perl Cookbook provides this technique for getting the intersection of two lists of integers:
@a = (1, 3, 5, 6, 7, 8); @b = (2, 3, 5, 7, 9); ... foreach $e (@a, @b) { $union{$e}++ && $isect{$e}++ } @union = keys %union; @isect = keys %isect;
I want this to be done (case insensitive) for two line lists. Any effective method please?
source share