Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: upto match please, my one-lina!!

by roboticus (Chancellor)
on Jun 09, 2006 at 04:05 UTC ( [id://554418]=note: print w/replies, xml ) Need Help??


in reply to Re^2: upto match please, my one-lina!!
in thread upto match please, my one-lina!!

D'oh!

I was having so much fun playing with one-liners that I forgot the parameters of the problem. I love that die trick.... I'll have to try it:

perl -ne '@t=(@t[1..4],$_,"---\n");die@t if/foo/' file
--roboticus

Replies are listed 'Best First'.
Re^4: upto match please, my one-lina!!
by jwkrahn (Abbot) on Jun 09, 2006 at 09:15 UTC
    @t=(@t[1..4],$_,"---\n")
    You are adding two lines for every one line you remove so every second line will be "---\n".

Log In?
Username:
Password:

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

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

    No recent polls found