in reply to To Dance or not to Dance with Dancer2? That is the question.

Be careful when mocking Template::Toolkit. It's quite powerful, in fact more powerful than it should be - it's a Turing-complete language.

The whole idea of Template (or any comparable renderer, say Text::Xslate, dozens of them) is the separation of logic from presentation - but with a very flexible presentation layer. You just give the templating engine a template and a hash of values - and the engine does the rest. Templates are much easier to edit than general-purpose code. I'm never ever coming back to $form->addElement("foo")->addValue("bar");

Dancer example shows only variable substitution for simplicity, but Template can do way more than that.

See Template documentation for more examples. I didn't have time to google a comprehensive portfolio though.

  • Comment on Re: To Dance or not to Dance with Dancer2? That is the question.