if (/^(Info I want.+)Start of Info/) { print $1 ; }
This still grabs the 'Info I want' part, which doesn't seem (despite the name) to be part of the desired info. Thus, exclude it. Meanwhile, we might as well make this a multi-line regular expression with the /m flag, so that the /./ can gobble up new-lines (which seems to be desired); explicitly notice that the Info I want and Start of Info should be on their own lines; and allow there to be nothing at all between the markers (unless we don't want that). This gives:
print $1 if ( /^Info I want$(.*)^Start of Info$/m )
(Of course, this makes the end-of-section marker 'Start of Info', which is slightly different from what the original poster said.) It's easy to gobble up leading and trailing new-lines, if they're not significant:
print $1 if ( /^Info I want\n+(.*?)\n+Start of Info$/m )
(Note the non-greedy quantifier.) Of course, this only fetches one occurrence of the info; if there might be many occurrences, then we can use a lazy quantifier as above with a while loop and the /g flag. If the original poster can change the format of the input files, then it might be appropriate to consider changing the markers and using Text::Balanced.

In reply to Re^2: Parse a block of text by JadeNB
in thread Parse a block of text by annie06

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.