in reply to Re: Re: Re: Help Matching Sections of a file
in thread Help Matching Sections of a file

What if you have multiple iterations of the same target search and you want to print them all to stdout? Your solution would fail in this arena.
  • Comment on Re: Re: Re: Re: Help Matching Sections of a file

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Help Matching Sections of a file
by TilRMan (Friar) on Apr 05, 2004 at 16:26 UTC

    Aye, it would. I can't find a prettier solution than:

    while (<FOO>) { if (my $ln = /bar/ .. /baz/) { print unless $ln =~ /E/; } }