Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: perl one line for advanced grep (current line and next one)

by Anonymous Monk
on Sep 02, 2013 at 16:58 UTC ( #1051959=note: print w/ replies, xml ) Need Help??


in reply to Re: perl one line for advanced grep (current line and next one)
in thread perl one line for advanced grep (current line and next one)

I'll golf it readable (untested):

perl -ne ' print, $aft++, next if /PAT/; $aft or next; print "$_---\n"; $aft = 0;'


Comment on Re^2: perl one line for advanced grep (current line and next one)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-07-04 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls