Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: HTML::Template vs. Template::Toolkit vs. ??

by moritz (Cardinal)
on Jan 07, 2009 at 19:44 UTC ( #734705=note: print w/replies, xml ) Need Help??

in reply to HTML::Template vs. Template::Toolkit vs. ??

I started out with using HTML::Template, it was the first template system that I knew, and I liked it.

I then read a Catalyst tutorial, and that used TT. I really liked it, and started using TT.

My first doubts about TT came when realized that it missed a killer feature that HTML::Template had: the default_escape option. It really makes all your worries about cross-site scripting go away.

When I tried to make my web apps "Unicode Safe" I moved them from HTML::Template to HTML::Template::Compiled, which has the open_mode option to get rid of my UTF-8 worries.

I started to write more things with Catalyst, DBIx::Class and TT, and came to the conclusion that this model, while much more powerful than HTML::Template + $otherStuff, tempted me to do bad things, like issuing DB queries from within the template (if you don't know what's bad about this, just think of how you'd handle error cases).

So these days I mostly use HTML::Template::Compiled again.

Replies are listed 'Best First'.
Re^2: HTML::Template vs. Template::Toolkit vs. ??
by Anonymous Monk on Jan 08, 2009 at 05:45 UTC
      what I don't quite like about that is, that if you need unescaped data, you have to decode it, so that produces extra work (encoding and directly after that decoding again), while in HTML::Template(::Compiled) no escaping at all happens if you use ESCAPE=0.
      Thank you, that looks nice (although I don't see an example of how the decoding works). The last time I asked, nobody had a convenient answer, so I guess things are improving still (which is a good sign).
Re^2: HTML::Template vs. Template::Toolkit vs. ??
by Anonymous Monk on Apr 21, 2009 at 16:06 UTC
    I'm currently using HTML::Template and having some Unicode issues. For example a parameter of '\x{a3}' gets converted to '\x{c2}\x{a3}' in the return value of 'output' - that is the individual UTF-8 bytes appear to get interpreted as Unicode code points. For reference this is a pound sign and the Unicode code point is '00A3' and the UTF-8 hex is 'C2','A3'.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://734705]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-12-03 07:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found