(You are Anonymous)

Added | Removed | Changed | Unmodified

Revision 30 Current
= A Comparison of templating systems used with CGI::Application   = A Comparison of templating systems used with CGI::Application  
   
The use of a templating system is one extremely important step towards creating   The use of a templating system is one extremely important step towards creating  
maintainable and reusable applications, as they make it possible to separate   maintainable and reusable applications, as they make it possible to separate  
the formatting of the pages from the application logic. You want to have this   the formatting of the pages from the application logic. You want to have this  
separation so that you can easily change the looks of your application without   separation so that you can easily change the looks of your application without  
messing around in the program, or even have the same program appear differently   messing around in the program, or even have the same program appear differently  
in different environments (Ideally, someone else than you, the application   in different environments (Ideally, someone else than you, the application  
developer, can also change the design, such as a web designer. In this case,   developer, can also change the design, such as a web designer. In this case,  
neither you nor the designer want the designer to have to mess with your Perl   neither you nor the designer want the designer to have to mess with your Perl  
code).   code).  
   
Unfortunately, templating systems in Perl are an extremely over-implemented   Unfortunately, templating systems in Perl are an extremely over-implemented  
genre. You can find dozens of them on CPAN and elsewhere. They all have their   genre. You can find dozens of them on CPAN and elsewhere. They all have their  
own distinctive features, benefits and drawbacks. It is very difficult to   own distinctive features, benefits and drawbacks. It is very difficult to  
choose the right one, and trying to give advice can lead to terrible flamewars.   choose the right one, and trying to give advice can lead to terrible flamewars.  
A very good   A very good  
[http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html article]   [http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html article]  
which compares several popular systems can be found at the Apache mod_perl   which compares several popular systems can be found at the Apache mod_perl  
project.   project.  
   
The two most popular templating systems for CGI::Application users seem to be   The two most popular templating systems for CGI::Application users seem to be  
   
* [HTML::Template HTMLTemplate]   * [HTML::Template HTMLTemplate]  
* [Template Toolkit TemplateToolkit]   * [Template Toolkit TemplateToolkit]  
   
Other recommended modules include:   Other recommended modules include:  
   
* [http://search.cpan.org/~jhiver/Petal/ Petal] - Perl implementation of Zope Page Templates which uses the [http://zope.org/Wikis/DevSite/Projects/ZPT/TAL/FrontPage Template Attribute Language (TAL)]   * [http://search.cpan.org/~jhiver/Petal/ Petal] - Perl implementation of Zope Page Templates which uses the [http://zope.org/Wikis/DevSite/Projects/ZPT/TAL/FrontPage Template Attribute Language (TAL)]  
   
== Online Poll   == Online Poll  
   
Maybe we can run a little poll here... Everyone just add a + for their favorite tool (and update the count):   Maybe we can run a little poll here... Everyone just add a + for their favorite tool (and update the count):  
   
Template Toolkit (19) +++++++++++++++++++   Template Toolkit (20) ++++++++++++++++++++  
HTML::Template (19) +++++++++++++++++++   HTML::Template (19) +++++++++++++++++++  
Petal (6) ++++++   Petal (6) ++++++  
Text::Template (2) ++   Text::Template (2) ++  
Text::Xslate (1) +   Text::Xslate (1) +  
home-made toolkit (1) +   home-made toolkit (1) +  
   
no template toolkit (1) +   no template toolkit (1) +  
   
== See Also   == See Also  
   
* The [plugins Plugins] page list several template-related plugins   * The [plugins Plugins] page list several template-related plugins  
   
* [http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html Which Templating System To Use], from perl.apache.org   * [http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html Which Templating System To Use], from perl.apache.org  
   
* A related topic is content management systems (CMS) which provide whole toolsets to manage a large amount of content. They usually also contain a templating system. A comprehensive list of Open Source Content Management Systems (Perl and others) can be found at http://www.la-grange.net/cms   * A related topic is content management systems (CMS) which provide whole toolsets to manage a large amount of content. They usually also contain a templating system. A comprehensive list of Open Source Content Management Systems (Perl and others) can be found at http://www.la-grange.net/cms