I have nothing against HTML::Template and I'm quite sure that it can handle much more than simple applications.

Template::Toolkit on the other hand is a more general templating solution which will equally well handle non-HTML / non-Web matters.

I use it regularly to write LaTex files which when rendered make nice lay-outed PDF-files. Although not impossible to do, it would require more effort to do so from a less performant templating system.

Its biggest strength is the way it can handle easily and elegantly, all kinds of data-structures (such as hashes of arrays of hashes of hashes of ...) and can use most of the standard Perl-modules (CGI, DBI, ...) directly from within itself. And before someone complains and starts a holy flame war: this indeed breaks the holy law of division of concerns and allows you to sneak in programming into your display layer, but sometimes it is damn handy to do so ...

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James


In reply to Re^3: Perl, Web Apps, HTML::Template, HTML::Mason and the future by CountZero
in thread Perl, Web Apps, HTML::Template, HTML::Mason and the future by novastorm0

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.