While not quite what you were asking, you might want to know that HTML::Template (also mentioned in a tutorial entitled HTML::Template Tutorial) does not require a file to contain the template, but can also be called initially with a reference to an array containing the template, which might be easier to manipulate. As well, HTML::Template can be used to generate text other than HTML.

As to __DATA__, I thought it was read-only (unless you start manipulating the source for later)... I could be wrong, however, and hope other monks will speak so we may both learn (and correct any errors I may have made, for which I ask forgiveness beforetimes)....

Update: Brother jeffa responded before I could submit, and in much better style. A very good read, and my hood's off to 'im.....

Update: Yes, Brother jeffa, I have indeed enjoyed the feel of braincells turning to mush upon exposure to the module you mentioned, and thus why I thought I might be incorrect....


In reply to Re: Getting data *INTO* __DATA_ by atcroft
in thread Getting data *INTO* __DATA_ by Zucan

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.