In Chapter 4, Section 4.8 (Computing Union, Intersection, or Difference of Unique Lists), the Perl Cookbook provides this technique for getting the intersection of two lists
Smallest amount of change required from the original solution. Just lower-case the strings.
@a = qw( a b c d ); @b = qw( C D E F ); ... foreach $e (@a, @b) { $union{lc $e}++ && $isect{lc $e}++ } @union = keys %union; @isect = keys %isect;