perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Wardley" <>
Subject ANNOUNCE: Template Toolkit v1.04
Date Mon, 06 Mar 2000 14:32:16 GMT
The latest version of the Template Toolkit (1.04) is now available
from CPAN:


The Template Toolkit is one of the many template processing modules
available from CPAN.  It's a pure 'template' module rather than an
embedded Perl processor and it promotes the separation of Perl code
(content) from HTML templates (presentation).  It doesn't try to
implement an entire programming language, preferring that you write
your code in a real programming language (i.e. Perl) and that you keep
it outside of your template documents.  This is generally a Good

The Template Toolkit is generic, fast and extensible and provides a
powerful mechanism for binding Perl values, lists, hashes,
sub-routines or objects into template variables.  This makes it
extremely simple to access any functionality or data that you care to
provide in Perl.  A plugin architecture allows you to load and use
external modules, giving you direct access to CGI, DBI, XML, or any
other modules or code to care to write or install.  The toolkit is
highly conigurable and can easily be extended or subclassed where
necessary.  It is independant of any operating environment
(e.g. mod_perl, CGI, offline batchscripts) and can be used to process
any kind of text document (e.g. HTML, XML, SGML, LaTeX, RTF, plain
text, etc.)

There's extensive documentation which describes the toolkit, a
tutorial, and a README file which gives a general overview and
introduction.  Here's some short template examples to give you a
flavour of what's possible.

    [% INCLUDE header
       title = 'Hello World!'

    The [% animal %] sat on the [% place %]

    [% IF user %]
      <a href="mailto:[% %]">[% %]</a>
    [% END %]

    [% FOREACH item = list %]
       <li>[% item %]
    [% END %]

ex2:  (DBI interface)

    [% USE DBI('DBI:mSQL:mydatabase') %]

    [% FOREACH user = DBI.query('SELECT * FROM user') %]
       <tr> <td>[% %]</td> <td>[% %]</td>
    [% END %]


Andy Wardley <>   Signature regenerating.  Please remain seated.
     <>   For a good time:

View raw message