My favorite is either Template Toolkit or HTML::Template. Both keep the code and HTML seperate, which I think makes everything much easier to deal with as you keep the presentation of your content seperate from the logic of the program.
HTML::Template is useful if all you need to do is replace values in a template, perhaps with some simple conditional processing. It goes to the extreme of keeping code and HTML seperate.
For anything very complicated, I go with Template Toolkit as it allows the construction of fairly complicated templating systems and has plugins for various things. It does mix code and HTML a little and even has something of its own language. But I've found that once you start dealing with templates that can end up looking very different based on user input, that extra flexibility gained by having some code in the template ends up making things much easier to understand (though I think you should still keep most of the logic in the Perl program that is calling the template and avoid using callbacks). Template Toolkit does have a little bit steeper learning curve, but once you understand the basic syntax, it's pretty easy.
In reply to Re: Your Favorite XHTML Template System
by Mr_Person
in thread Your Favorite XHTML Template System
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |