Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Copy Lines After Match

by NetWallah (Canon)
on Dec 17, 2015 at 01:12 UTC ( [id://1150566]=note: print w/replies, xml ) Need Help??


in reply to Copy Lines After Match **UPDATE**

The standard way to approach this is :
  • Declare a variable and initialize to zero (my $tog=0) (This is OUTSIDE THE LOOP)
  • In the loop, Compare the input with $find, and take one of the following actions:
  • On MATCH, set $tog=1, and skip the rest of the loop
  • on NO MATCH, check $tog, if it is 1, print the line to the output
Try to code this logic in, and if you have trouble with the code, post it, explain your issue(s), and we can help you along.

        "I can cast out either one of your demons, but not both of them." -- the XORcist

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found