in reply to How to print lines between two patern only one time, not multiple timese as pattern exists in this file multiple times.

The problem is that the right part of the flip-flop is never true, as it contains the $i < 2 condition together with the regex. If you want to stay with the flip-flop, I'd modify it to something like the following:
my $i = 1; while (<DATA>) { if ($i and /Startpoint/ ... /slack/ && $i--) { print $_; } }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: How to print lines between two patern only one time, not multiple timese as pattern exists in this file multiple times.
  • Select or Download Code