#============================================================= -*-perl-*-
#
# Template::Tutorial::Web
#
# DESCRIPTION
# Tutorial on generating web content with the Template Toolkit
#
# AUTHOR
# Andy Wardley
#
# COPYRIGHT
# Copyright (C) 1996-2008 Andy Wardley. All Rights Reserved.
#
# This module is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
#========================================================================
=head1 NAME
Template::Tutorial::Web - Generating Web Content Using the Template Toolkit
=head1 Overview
This tutorial document provides a introduction to the Template Toolkit and
demonstrates some of the typical ways it may be used for generating web
content. It covers the generation of static pages from templates using the
L and L scripts
and then goes on to show dynamic content generation using CGI scripts and
Apache/mod_perl handlers.
Various features of the Template Toolkit are introduced and described briefly
and explained by use of example. For further information, see L,
L and the various sections within it. e.g
perldoc Template # Template.pm module usage
perldoc Template::Manual # index to manual
perldoc Template::Manual::Config # e.g. configuration options
The documentation is also available in HTML format to read online, or download
from the Template Toolkit web site:
http://template-toolkit.org/docs/
=head1 Introduction
The Template Toolkit is a set of Perl modules which collectively
implement a template processing system.
A template is a text document with special markup tags embedded in it.
By default, the Template Toolkit uses 'C<[%>' and 'C<%]>' to denote
the start and end of a tag. Here's an example:
[% INCLUDE header %]
People of [% planet %], your attention please.
This is [% captain %] of the
Galactic Hyperspace Planning Council.
As you will no doubt be aware, the plans
for development of the outlying regions
of the Galaxy require the building of a
hyperspatial express route through your
star system, and regrettably your planet
is one of those scheduled for destruction.
The process will take slightly less than
[% time %].
Thank you.
[% INCLUDE footer %]
Tags can contain simple I (like C and C) and more
complex I that start with an upper case keyword (like C).
A directive is an instruction that tells the template processor to perform
some action, like processing another template (C and C