I agree with Mutant. However, sometimes HTML::Template is quite limited (especially for complex "IF" statement).
I'd advise to extend HTML::Template by using HTML::Template::Expr, that is fully compatible with the former (through object heritage I guess), but allows you to do more.