Jesse Erlbaum wrote:

The big players are Template::Toolkit and HTML::Template. It's no
secret that I'm a fan of HTML::Template -- Sam and I worked together
when he wrote it, and my module, CGI::Application, uses it out of the
box (although it does support TT).


I use HTML::Template because designers can't be trusted to set
variables.  Boolean logic is about all their simple minds can handle.
Anything which doesn't look like HTML is likely to cause them to have a
stroke.  Yes, I'm a programmer-snob and a fascist, and I like to take
sharp objects away from the gentle "creative" types.

Aside from the fact that HTML::Template uses less RAM and is faster than
TT, this is the foremost reason I continue to use it.

I used to use HTML::Template for projects, but I moved to Template::Toolkit because I felt the former's syntax was just too limited. I know we want to separate code and logic, but H::T keeps me from even referencing the attribute of an object. You can't say


<TMPL_VAR NAME="user.name">

and pass in a user object with the attribute (method) or even a hash key called name. You have to either treating it like a loop with one item (because loops use arrayrefs of hashrefs) or flatten it into variable names in your code. In a good OO system with objects representing the data model, I found it exhausting to use H::T when I could just to this in TT:

[% user.name %]


Am I just being stupid, or are there better ways of doing these things in H::T?




--
Barry Hoggard
Tristan Media LLC
e: [EMAIL PROTECTED]
w: www.tristanmedia.com
aim: hoggardb



Reply via email to