in reply to Remove a line of text
And, it will even make sure that you kick out of the while loop when the file is empty.while (my $theLine = <INPUT>) {
while (my $TheLine = <INPUT>) { if ($TheLine =~ /<RD>[^\n]*Status Compendium<<.JL>/i) { my $ListPos = 0; until($ListPos > $#WordList) { if ($TheLine eq $WordList[$ListPos]) { $TheLine = ""; pop(@WordList) } $ListPos +=1 } } print OUTPUT "$TheLine"; }
Also - read up on pop. I don't think it does what you think it does.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|