in reply to Re: Simplifying repetitive flow structures
in thread Simplifying repetitive flow structures

That code does look pretty terrible when it's line wrapped. I'm not using HTML::Template for alot of reasons - mostly because this is running under mason/mod_perl and I'm trying to limit the number of differnt things to maintain. Code/html seperation with Mason is something I've considered. However your example doesn't simplify the problem. I still have to deal with variable numbers of columns with differing names depending on the value of "$type" and in addition to that the person may or maynot have an image in the directory as well (if 'pic' is defined or not).
  • Comment on Re: Re: Simplifying repetitive flow structures

Replies are listed 'Best First'.
Re: Re: Re: Simplifying repetitive flow structures
by gav^ (Curate) on Apr 01, 2002 at 04:47 UTC
    HTML::Template works great under mod_perl. Look in the FAQ section of the docs and set cache/shared_cache in the call to HTML::Template->new. If HTML::Template doesn't cut it then Template Toolkit (or here) is more powerful has support for expressions amongst things. Code/HTML seperation for me is not just a "good thing" it is a business critical thing. Generating HTML with CGI.pm just doesn't cut it in 2002.

    I gave a answer for the question you asked. I can only work with the information you gave, and I thought I covered all the bases. Maybe you need to re-think the design? Poor implementations are normally a symptom of bad design.

    gav^

      We're currently using the HTML::Template caching under Fast CGI and it works great. You read all the templates in when the server starts and it makes everything a little snappier.

      -biz-