4:45
 ?÷     package HTML::Template;

$HTML::Template::VERSION = '2.97';

=head1 NAME

HTML::Template - Perl module to use HTML-like templating language

=head1 SYNOPSIS

First you make a template - this is just a normal HTML file with a few
extra tags, the simplest being C<< <TMPL_VAR> >>

For example, test.tmpl:

    <html>
    <head><title>Test Template</title></head>
    <body>
    My Home Directory is <TMPL_VAR NAME=HOME>
    <p>
    My Path is set to <TMPL_VAR NAME=PATH>
    </body>
    </html>

Now you can use it in a small CGI program:

    #!/usr/bin/perl -w
    use HTML::Template;

    # open the html template
    my $template = HTML::Template->new(filename => 'test.tmpl');

    # fill in some parameters
    $template->param(HOME => $ENV{HOME});
    $template->param(PATH => $ENV{PATH});

    # send the obligatory Content-Type and print the template output
    print "Content-Type: text/html\n\n", $template->output;

If all is well in the universe this should show something like this in
your browser when visiting the CGI:

    My Home Directory is /home/some/directory
    My Path is set to /bin;/usr/bin

=head1 DESCRIPTION

This module attempts to make using HTML templates simple and natural.
It extends standard HTML with a few new HTML-esque tags - C<< <TMPL_VAR> >> 
C<< <TMPL_LOOP> >>, C<< <TMPL_INCLUDE> >>, C<< <TMPL_IF> >>, C<< <TMPL_ELSE> >> 
and C<< <TMPL_UNLESS> >>.  The file written with HTML and these new tags
is called a template.  It is usually saved separate from your script -
possibly even created by someone else!  Using this module you fill in the
values for the variables, loops and branches declared in the template.
This allows you to separate design - the HTML - from the data, which
you generate in the Perl script.

This module is licensed under the same terms as Perl. See the LICENSE
section below for more details.

=head1 TUTORIAL

If you're new to HTML::Template, I suggest you start with the
introductory article available on Perl Monks:

    http://www.perlmonks.org/?node_id=65642

=head1 FAQ

Please see L<HTML::Template::FAQ>

=head1 MOTIVATION

It is true that there are a number of packages out there to do HTML
templates.  On the one hand you have things like L<HTML::Embperl> which
allows you freely mix Perl with HTML.  On the other hand lie home-grown
variable substitution solutions.  Hopefully the module can find a place
between the two.

One advantage of this module over a full L<HTML::Embperl>-esque solution
is that it enforces an important divide - design and programming.
By limiting the programmer to just using simple variables and loops
in the HTML, the template remains accessible to designers and other
non-perl people.  The use of HTML-esque syntax goes further to make the
format understandable to others.  In the future this similarity could be
used to extend existing HTML editors/analyzers to support HTML::Template.

An advantage of this module over home-grown tag-replacement schemes is
the support for loops.  In my work I am often called on to produce
tables of data in html.  Producing them using simplistic HTML
templates results in programs containing lots of HTML since the HTML
itself cannot represent loops.  The introduction of loop statements in
the HTML simplifies this situation considerably.  The designer can
layout a single row and the programmer can fill it in as many times as
necessary - all they must agree on is the parameter names.

For all that, I think the best thing about this module is that it does
just one thing and it does it quickly and carefully.  It doesn't try
to replace Perl and HTML, it just augments them to interact a little
better.  And it's pretty fast.

=head1 THE TAGS

=head2 TMPL_VAR

    <TMPL_VAR NAME="PARAMETER_NAME">

The C<< <TMPL_VAR> >> tag is very simple.  For each C<< <TMPL_VAR> >>
tag in the template you call:

    $template->param(PARAMETER_NAME => "VALUE") 

When the template is output the C<< <TMPL_VAR>  >> is replaced with the
VALUE text you specified.  If you don't set a parameter it just gets
skipped in the output.

You can also specify 