Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: The hidden charm of Template::Toolkit (and templates generally)

by eserte (Deacon)
on Jan 06, 2008 at 22:29 UTC ( #660705=note: print w/ replies, xml ) Need Help??


in reply to The hidden charm of Template::Toolkit (and templates generally)

My rule of thumb is: if you need to generate text, then use a templating language if the dynamic part is much smaller than the already present static part of the text. I use Template-Toolkit for a lot of text generating, not necessarily HTML. Often it's just existing Makefiles or mapserver files or crontabs or some configuration files, which just need minor tweaks when running in different environments. So I can leave the files nearly as is, put some templating directives in it, and do not need to wrap it in a perl script.

Using a templating system is not necessary for the separation of concerns (layout vs. logic). If you're fine with generating html by perl code, and you really don't need any HTML coders to create the html, then do it so! But do it in a different function or module than the code doing the logic. This is enough to separate logic and layout.


Comment on Re: The hidden charm of Template::Toolkit (and templates generally)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-10-25 20:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (148 votes), past polls