[roch-pm] Techniques for templates

Brian Mathis bmathis at directedge.com
Thu Oct 26 17:07:09 CDT 2000


Richard Martin Woodward wrote:
> 
> Hi, Brian.
> 
> Another way is to--"use HTML::Template;".
> 
> This allows your template to be customized independently
> of your perl program.  Of course, the template can be
> modified by your "user," and this can be an attractive part
> of your end product.
> 
> A lot of work went into the design of the HTML::Template
> module.  You don't want to reinvent that wheel each time you
> write an CGI application to produce customized HTML.
> 
> I followed that approach with my HTML_Search program, and
> everything went smoothly as I tested it on my PC running Win98
> and the Apache server.  Unfortunately, the www host I use to run
> HTML_Search (see http://www.richardwoodward.com)
> doesn't currently support HTML::Template. But I was able to
> write my own stripped-down version (about 150 lines of Perl)
> to replace HTML:Template.

You can actually install modules yourself, into your home account or the
same directory as your script, as long as you have shell access.

> The beauty of the HTML::Template; approach is that you are
> forced to separate algorithmic considerations (i.e., figuring out
> *what* to show) from display considerations (i.e., how to show it)
> as you program an application to be HTML:Template compatible.

Yes, that's one of my biggest concerns.  If I change the design, I have to
wade through all this html in a perl script too.

> In summary, I recommend using HTML::Template when it is
> important to have a clean interface to your (separate) HTML
> display code.
> 
> Regards,
> Richard Martin Woodward
> perl_monger at richardwoodward.com


-- 
Brian Mathis
Direct Edge
http://www.directedge.com
--
For information on unsubscribing from this list, please visit
http://rochester.pm.org



More information about the Rochester-pm mailing list