sub search { $matchcounter = 0; @terms = split(/\s+/, $FORM{'terms'}); foreach (@names) { $string = join(' ',@names); $string =~ s/\n//g; foreach $term (@terms) { if ($FORM{'case'} eq 'Insensitive') { if (!($string =~ /$term/i)) { $include{$matchcounter} = 'no'; last; } else { $include{$matchcounter} = 'yes'; } } } } }