Thank you for taking the time to reply, and providing all those suggestions.

Ad 1: Noted. I expect that due to this behavior, even if I wanted interpolation, it would still be better ( in terms of style) to write <<"ENDS" to make the fact (that I am aware of this) explicit.

Ad 2&3: Excellent stuff, I was not aware of this possibility (multiple here-docs in the same line). Thank you!

Ad 4: Very interesting. I assume that the danger associated with grep is the fact that it will remove both undef (as intended) and anything that evaluates as non-true (could pose a problem). Is there any other danger involved? Not that it would matter much, as your solution is definitely better, but I'm just curious.

Ad 5: Slurping __DATA__ is exactly what I had in mind when asking about possible split usage.

- Luke


In reply to Re^2: Storing multiple blocks of text in the __DATA__ section by blindluke
in thread Storing multiple blocks of text in the __DATA__ section by blindluke

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.