Here's another one-liner that doesn't use a begin block:
perl -ni.bak -e "print; /word/ && last;" file.txt
When the thought came to me, I was surprised at how simple the solution turned out to be.
Dave
In reply to Re^2: grep and delete
by davido
in thread grep and delete
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |