Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: (ebm)Remove multiple lines of text

by earthboundmisfit (Chaplain)
on Sep 21, 2001 at 08:55 UTC ( [id://113790]=note: print w/replies, xml ) Need Help??


in reply to Remove multiple lines of text

I'm a bit confused by what you're trying to accomplish here:
$TheLine = $_; while (my $TheLine = <INPUT>) { # ....etc. }
You're overwriting $TheLine with the default variable, "it" ($_) outside your loop and then creating another $TheLine that is out of scope (within the loop).

Here's one way of doing what I think you want. It's probably not the most advanced way, but I hope it makes sense and helps in your understanding of what's gone wrong.

@lines = <INPUT>; for (@lines) { if (/<RD>[^\n]*Status Compendium<<.JL>/i ) { # notice that $_ is assumed here foreach my $word (@WordList) { print OUTPUT if($_ ne $word) # here we need $_ for camparison (?) } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://113790]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found