foreach my $r (@spy) { if($input =~ /$r/i){ $findings .= ' ' . $r; $fn++; } }