use strict; use warnings; my @strings = ( "APPCRASH.", "he protected system file.", "EMET_DLL Module logged the following event:.", "your virus/spyware.", "A new process has been created\..", "A service was installed in the system\..", "A scheduled task was created\..", "Logon Type:[\\W]*(3|10).", "\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run.", "service terminated unexpectedly\..", "service was successfully sent a.", "service entered the.", "service was changed from." ); my $match = join '|', map {qr/\Q$_\E/} @strings; while (defined (my $info = )) { chomp $info; next if $info !~ /($match)/; print "Line # $.: '$1' --> '$info'\n"; } __DATA__ APPCRASH. nothing to see here Part sentence: service entered the.