When I first had to choose a templating scheme for our company, I investigated several options. HTML::Template and Template Toolkit were the two most likely candidates. Even though HTML::Template could have satisfied our needs at the time, I was concerned that, with some of the projects we were planning, that it might become a bottleneck. On the other hand, if we took the trouble to learn Template Toolkit up front, we would have a vastly more powerful templating system available, albeit with potential that we were not tapping.

flash forward almost two years

Many people use templates by creating a program, assembling the data, then calling the template and passing it the data. For my current project, I need to create documents out of multiple templates all tied together, some with dynamic content from a variety of different sources. As a result, I am inverting the process and having templates call programs (plugins). This allows me a much richer templating environment. I don't think I could have done that very easily with HTML::Template.

If your documents are not likely to be terribly complicated, HTML::Template is a fine tool.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re(2): Dynamically altering static TT templates by Ovid
in thread Dynamically altering static TT templates by Ovid

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.