"Now whether this increases clarity or adds to the general confusion..."
Now that's a good question if you ask me. Be aware that the @{[]} construct allows you to stuff any code inside the square brackets, be it merely a function call or a loop or an ugly if..elsif..elsif..else sequence, or whatever. That's tempting but you're likely to end up with your whole program consisting of a print statement,one big here-document, and all the rest of it scattered here and there in the here-doc.

I would definitely stay with the option of running the code beforehand to feed any local variable, and then use these variables within the here-docs. Or go a step further and use templating solutions like HTML::Template or the Template Toolkit.

--bwana147


In reply to Re: Re: Embedding fuction output by bwana147
in thread Embedding fuction output by RatArsed

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.