We probably should discuss this out. It is important.

While I agree, that a templating system has many advantages over a simple here doc (HD), it is also true that a HD with interpolation is already a simple templating system.

Furthermore if you have a close look at all the templating modules at CPAN, you will find there some enabling "real perl processing", thus inlining perl into templates. Wuuuh... Bad idea. So instead of inlining text into Perl (HD), you inline a template into perl only to find, that you need more expressive power so you inline Perl into the text you inlined into Perl. Very bad.

Lets assume our standard case. For every nontrivial HTML document (heavy-duty dynamics), you have not only to interpolate variables, but also do some more processing which is done in some subroutines/submodules. So what do you do? You use Perl to generate the document and use HDs for the simple things/static parts.

Now to sum up what impression I really get: many templating system advocates are blind because of the greater expressional power of the templating system (compared to HD), so they try to apply templating to every document generation.

This is wrong IMHO. Speaking of expressional power you have

E(Perl) >> E(Template) >> E(HD)
Don't try to warp the Perl/Template ordering. Just believe me. Been there - done that.

Bye
 PetaMem
    All Perl:   MT, NLP, NLU


In reply to Re: Re: The scope of templates by PetaMem
in thread I need a title - sucka! :-) by PetaMem

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.