Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do you move within an array using foreach?

by jj808 (Hermit)
on Oct 10, 2002 at 18:41 UTC ( [id://204274]=note: print w/replies, xml ) Need Help??


in reply to How do you move within an array using foreach?

I read the question as 'print everything after [foo] until you get to [foo2] - don't print [foo2] itself but print everything that comes after it'.
cat foofile | perl -ne 'if (/\[foo\]/){$print++;next};next if /\[foo2\ +]/;print if ($print)'
JJ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-19 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found