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