Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: HTML::Template : How to separate code and html with lesser maintenance issues

by tinita (Parson)
on Nov 21, 2006 at 12:19 UTC ( #585242=note: print w/replies, xml ) Need Help??


in reply to HTML::Template : How to separate code and html with lesser maintenance issues

you could use HTC's switch/case tag.
HTC doesn't have expressions yet, but switch/case allows simple string comparison.

<tmpl_switch name="item"> <tmpl_case SELECT> ... <tmpl_case CONTINUE> ... <tmpl_case DENIED> ... </tmpl_switch>
  • Comment on Re: HTML::Template : How to separate code and html with lesser maintenance issues
  • Download Code

Replies are listed 'Best First'.
Re^2: HTML::Template : How to separate code and html with lesser maintenance issues
by sara2005 (Scribe) on Nov 21, 2006 at 18:16 UTC

    Thanks for the info.

    But the documentation for HTC says that it could slow down things under certain circumstances, which I don't want. I would rather try to do things with just H::T

    The best performance gain is probably reached in applications running under mod_perl, for example. If you don't use memory caching (e.g. CGI environment), HTC will be even slower than H::T. If you don't use caching at all (e.g. CGI environment without file caching), HTC will be much slower than H::T and TT

      But the documentation for HTC says that it could slow down things under certain circumstances
      yes, if you are in a CGI environment and you can't use filecaching, for whatever reason.
      but in that case your script will be slow anyway because the interpreter has to start it all over again every request, so the speed difference won't be that big compared to the overall execution time.
      and last but not least, if speed is *that* crucial for you you should switch to mod_perl or FastCGI anyway.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2023-01-27 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?