If you are not using mod_perl for the dynamic CGI, Template Toolkit may not be the better of the two, because it's slow to load and parse a page (it actually creates perl code); further calls to the same template are speedy, but until you have those calls made, it takes a while. In a non-mod_perl environment, you have no way to store this nice little cache, as opposed to where you can have a mod_perl global sit and cache all TT2 page requestions. HTML::Template is faster but not as powerful, but I think in your situation, it will work better since it merely just in-place regexing, which will be faster in the long run.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
| [reply] |
I am biased.
Any template langauge that lets you 'code' in the template is bad. Logic goes in the code, not the template.You don't want to be debugging logic in more than one place.
You should always have to update your script when logic changes, even if it is minor. Life is easier for your programmers if the code is a black box for your web guys.
And besides, try telling your web guys they can't use dreamweaver with the templates (HTML::Template can use <!-- TMPL_VAR NAME="foo" --> syntax). | [reply] [d/l] |
| [reply] |
I agree in principle, but there are situations where it's easier to put logic in the template. If, for example, a template is built with several other templates selected at run-time based on input values, it seems like it would be more difficult with HTML::Template than TT2. Allowing some logic in the template frees programmer time to write code while designers can build new templates without requiring cgi modifications.
| [reply] |
I generally agree, and we use HTML::Template on projects at work in large part because it keeps "web guys" out of programming. But one of those guys has a good knowledge of databases and can turn out a utility script when needed; we're considering the move to Template Toolkit because it would take better advantage of his skills.
For people who ought not to be mucking about with programming, well, just keep them out of the more complex templates. There's nothing in TT2 that stops you from compartmentalizing things to the appropriate skill level.
| [reply] |
| [reply] |