Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: seek and process from there on

by davorg (Chancellor)
on May 30, 2006 at 14:07 UTC ( [id://552500]=note: print w/replies, xml ) Need Help??


in reply to seek and process from there on

Sounds like a perfect use for the flip-flop operator.

use strict; use warnings; while (<DATA>) { next unless /^internal name/ .. 0; next unless /^need this/; # your code here... print $_; } __DATA__ a line need this (not really) another line internal name another line a further line need this another line need this

Note that by using a zero as the righthand operand, we get a flip-flop that turns on but then never turns off.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found