I was reading the Perl docs on heredoc just now, and found one description that I found very confusing. I'm hoping you can help me understand what's being described here: http://perldoc.perl.org/perlop.html#Quote-Like-Operators

Specifically, this part:

If you use a here-doc within a delimited construct, such as in s///eg, the quoted material must come on the lines following the final delimiter. So instead of

s/this/<<E . 'that' the other E . 'more '/eg;
you have to write
s/this/<<E . 'that' . 'more '/eg; the other E

I understand the part about placing the heredoc after the s// construct, but the substitution itself is confusing. Does it mean the same as this?

s/this/the other\nthatmore /eg;
I guess I'm wrong to assume those periods are concatenation operators, but if so, what's going on here? What's the use case?

Thanks very much in advance!


In reply to heredoc within a delimited construct by BeneSphinx

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.