++$seen{lc($_)} for split /\s+/, $zipFile; if ($seen{this} && $seen{$that}) { .... } #### if ($zipFile =~ /\bthis\b/i && $zipFile =~ /\bthat\b/i) { .... }