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