Well, I mentioned HTML::Template just as an example, not to force the use of it. You can use any toolkit you like to build the HTML pages of course. I did say 'etc', didn't I?
%^p
| [reply] |
my post was no criticism but just a question.
every time it comes to dynamic HTML, all posts refere to HTML::Template but no one to Template Toolkit. so i was wondering if there is something wrong with this module or the monks here are just used to HTML::Template since itīs the older module (i think).
Template Toolkit (aka TT2) is mutch more versatile (i think), so iīd like to see some opinions on this from other monks here.
| [reply] |
HTML::Template is generally considered the easiest templating module to get up and running right now. It is definitely less versatile, but its design goals are also less ambitious. It (unlike Mason, TT, or ASP) is not a content-management system.
H::T also has the neat benefit of allowing the HTML to maintained by a non-Perl developer. Mason and TT require a larger learning curve for the template maintainers. They also require more design-time up-front.
It's not just a matter of more used to this or that ... it's a matter of what's the right tool for the job. I'll give you an example.
I'm currently in the midst of converting a number of reports from Oracle's ReportBuilder to Perl. I chose HTML::Template for the HTML generation. Reasons?
- I needed to get something up and running right now. H::T is better for that (and the TT and Mason people will tell you that, too).
- I had to generate PDF, Excel, and graphs, with the same data. I may be a little out of touch, but I'm pretty sure neither Mason nor TT will do that. H::T has a few friends that will. (PDF::Template, Excel::Template, and the soon-to-be-released Graph::Template.)
- I'm not going to maintain the HTML - the site designers will.
Now, in a few months when things stabilise, it's very possible we might switch to Mason or TT. We might need that content management support. Then again, we might not. (The project isn't very well defined.)
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
| [reply] |
Thats maybe a little unfair, but only a little!
I too point people to HTML::Template, not because it is better but because it is much simpler, and to be totally honest, it is all that most applications require. Template Toolkit is great and Andy Wardley has done a terrific job with it, there are also a number of 'plug-in' modules that go with it. If you want something to do more than just deliver HTML then Template Toolkit is worth a serious look.
As for me, I looked at it. Got scared by the degree of complexity and ran away! Went back a few months later and still had the same thoughts. It has a steep learning curve. HTML::Template, on the other hand, is much simpler and you can master it in a day for doing the sort of things youare talking about.
jdtoronto
PS I have another project coming up shortly where I feel that TT will be suited and I will use it then. For now I am serving up stuff from a database and HTML::Template does everything I need.
| [reply] |