if ($TheLine =~ /[^\n]*Status Compendium<<.JL>/i) { $ListPos = 0; until($ListPos > $#WordList) { if ($TheLine eq $WordList[$ListPos]) { $TheLine = ""; pop(@WordList) } $ListPos +=1 } } print OUTPUT "$TheLine"; #### if ($TheLine =~ /[^\n]*Status Compendium<<.JL>/i) { for(my $i=0; $i > @WordList; $i++) { print OUTPUT $TheLine if ($TheLine ne $WordList[$i]) } }