in reply to Parse a block of text

Exclude the line you don't want.
if (/^Info I want/../^Start of Info/) { unless ( /^Start of Info/ ) { print; } }
Yes, there's a nifty-keen way to do it with regexes, but this is simpler, less error-prone, and easier for your maintainers to understand.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Parse a block of text
by annie06 (Acolyte) on Jul 07, 2008 at 19:31 UTC
    that works, thanks so much! Just curious, how would you do it with regexes?
      Your problem is that you're reading a line at a time. This means you don't have the information you need until it's too late. You'd have to switch to reading two lines at a time and that's just silly. But, you'd use a positive lookahead, in-string line anchors, and the sm modifiers.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?