in reply to Re: How can i catch strings matching a regex across multiple lines?
in thread How can i catch strings matching a regex across multiple lines?

I dont think the problem has anything to do with $id.

The much bigger potential perpetrator is the "$/" setting.
Since you expect to be reading lines, you need a record separator - otherwise, the entire stream will be "slurp"ed, and you will see only one record, which matches your symptoms.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

  • Comment on Re^2: How can i catch strings matching a regex across multiple lines?

Replies are listed 'Best First'.
Re^3: How can i catch strings matching a regex across multiple lines?
by aaron_baugher (Curate) on Jun 30, 2012 at 23:42 UTC

    Not quite. See perlvar, "INPUT_RECORD_SEPARATOR": setting $/ to an empty string sets the input record separator to "two or more consecutive empty lines." That's what he wants here, since his records are separated by a blank line.

    Aaron B.
    Available for small or large Perl jobs; see my home node.