Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Getting next line after matched one

by rnahi (Curate)
on Dec 30, 2004 at 20:58 UTC ( #418400=note: print w/ replies, xml ) Need Help??


in reply to Getting next line after matched one

The one-liner approach:

$ cat input.txt one two three four five six seven $ perl -ne 'print $_ = <> and last if /five/' input.txt six


Comment on Re: Getting next line after matched one
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-18 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (50 votes), past polls