Home arrow Perl Programming arrow Page 4 - Getting Started with the Perl Template Toolkit

Documentation and Support - Perl

This chapter compares the Template Toolkit to other templating systems such as HTML::Mason and HTML::Template, describes how to install it, then shows you what templates look like and how to process them. (From the book, Perl Template Toolkit, O'Reilly Media, ISBN: 0596004761, by Darren Chamberlain, Dave Cross and Andy Wardley.)

  1. Getting Started with the Perl Template Toolkit
  2. The Templating Ecosystem
  3. Installing the Template Toolkit
  4. Documentation and Support
  5. Using the Template Toolkit
  6. The Template Module
  7. The Template Toolkit Language
  8. Dynamic Variables
  9. Template Processing Directives
  10. Integrating and Extending the Template Toolkit
By: O'Reilly Media
Rating: starstarstarstarstar / 23
July 28, 2004

print this article



In this section, we take a look at the support that is available for the Template Toolkit.

Viewing the Documentation

The Template Toolkit comes with an incredible amount of documentation. The documentation is supplied in the standard Perl Plain Old Documentation (POD) format. Once you have installed the Template Toolkit, you can see any of the documentation pages using perldoc or man, just as you can with any other Perl module:

$ perldoc Template    # should always work
$ man Template        # does not work everywhere

During the Template Toolkit installation procedure you are offered the chance to install HTML versions of the documentation. The default location for the installation of these files is /usr/local/tt2 under Unix and C:/Program Files/Template Toolkit 2 under Win32. The installation procedure prompts for alternate locations.

If you are running a web server on your local machine, you can configure it to know where these files are. For example, you might put the contents of Example 1-4 in the httpd.conf for an Apache web server.

# TT2 Alias /tt2/images/     /usr/local/tt2/images/ Alias /tt2/docs/             /usr/local/tt2/docs/html/ Alias /tt2/examples/         /usr/local/tt2/examples/html/

<Directory /usr/local/tt2/>
     Options Indexes 
     AllowOverride None 
     Order allow,deny
     Allow from all

Example 1-4. Apache configuration directives to view Template Toolkit documentation

You can now access the locally installed documentation by pointing your browser at http://localhost/tt2/docs. For more information on configuring your web server, see the INSTALL file that comes with the Template Toolkit.

The complete documentation set is also available online at the Template Toolkit web site. You can find it at http://www.template-toolkit.org/docs.html.

Overview of the Documentation

A large number of manual pages come with the Template Toolkit. Here is a list of some of the most useful ones:


The manual page for the Template module, the main module for using the Template Toolkit from Perl.


An introduction and table of contents for the rest of the manual pages.


A brief introduction to using the Template Toolkit. Not unlike this chapter.


The syntax, structure, and semantics of the Template Toolkit directives and general presentation language. Chapter 3 covers this aspect.


A description of the various ways that Perl data can be bound to variables for accessing from templates. Chapter 3 also has the details.


A reference guide to all Template Toolkit directives, with examples of usage. See Chapter 4.


A guide to the virtual methods available to manipulate Template Toolkit variables. These are also covered in Chapter 3.


A guide to the various standard filters that are supplied with the Template Toolkit. See Chapter 5.


A guide to the various standard plugins that are supplied with the Template Toolkit. See Chapter 6.


An overview of the internal architecture of Template Toolkit. See Chapter 7.


Details of the configuration options that can be used to customize the behavior and extend the features of the Template Toolkit. This is covered in the Appendix.


A description of dynamic views—a powerful but experimental feature in the Template Toolkit. The use of views is covered briefly in Chapter 9.


An introduction and table of contents to the tutorials that are distributed with Template Toolkit. Currently there are two. Template::Tutorial::Web is a quick start to using the Template Toolkit to create web pages, and Template::Tutorial:: Datafile is a guide to creating datafiles in various formats (particularly XML). See Chapter 2 and Chapter 10 for more information about using the Template Toolkit to generate web pages and XML, respectively.

Template::Library::HTML and Template::Library::Splash

Two guides to using libraries of user interface components (widgets) for creating HTML with the Template Toolkit.


A list of the various Perl modules that make up the Template Toolkit. Each module has its own manual page.

Accessing the Mailing List

If you can’t find the answer to your questions in any of the documentation, you can always turn to the mailing list set up for discussion of the Template Toolkit. You can subscribe to the mailing list at: http://template-toolkit.org/mailman/listinfo/templates. All previous posts are archived at: http://templatetoolkit.org/pipermail/templates.

Activity on the list is moderate (around 100 messages per month) and many of the Template Toolkit experts are on the list.  

Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

Visit the O'Reilly Network http://www.oreillynet.com for more online content.

>>> More Perl Programming Articles          >>> More By O'Reilly Media

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Perl Turns 25
- Lists and Arguments in Perl
- Variables and Arguments in Perl
- Understanding Scope and Packages in Perl
- Arguments and Return Values in Perl
- Invoking Perl Subroutines and Functions
- Subroutines and Functions in Perl
- Perl Basics: Writing and Debugging Programs
- Structure and Statements in Perl
- First Steps in Perl
- Completing Regular Expression Basics
- Modifiers, Boundaries, and Regular Expressio...
- Quantifiers and Other Regular Expression Bas...
- Parsing and Regular Expression Basics
- Hash Functions

Developer Shed Affiliates


Dev Shed Tutorial Topics: