in reply to Re^2: how to next line after the pattern in perl
in thread how to next line after the pattern in perl

"...catch consecutive lines...?
and
Correct but fundamentally....

Interesting proposition which points up a (possible) ambiguity or shortcoming in the original problem statement: What should be done when a second consecutive matching line exists?

Update: Fixed punct at the end of the first li from "?" to ")"
while LOL at kennethk's reply

  • Comment on Re^3: how to next line after the pattern in perl

Replies are listed 'Best First'.
Re^4: how to next line after the pattern in perl
by kennethk (Abbot) on Jun 09, 2010 at 20:03 UTC

    Perhaps an appropriate solution?

    use strict; use warnings; my $flag = 0; while (<DATA>) { print if $flag; if ($flag and /XXXX/) { eval('$demons->fly_out($nose)'); } $flag = /XXXX/; } __DATA__ ZZZZZZZZZZZZ YYYYY XXXX XX XXXX 3333 ii XXXX asdfddd