$currentSentence =~ s/[\ba\b|\ban\b|\bthe\b]//g; #### if($currentSentence =~ /([\S]+) ([\S]+) lines?<\/head>/) { if ($2 =~ /[\ba\b|\ban\b|\bthe\b]/) { print "$2\n"; print $DST "$1"; } else { print $DST "$2"; } }