#!/usr/bin/perl use strict; use warnings; use Template; # create template processor my $tt = Template->new(); # define data my $data = { copyright => '© 2002 Andy Wardley', weblinks => [ { url => 'http://perl.apache.org/', title => 'Apache/mod_perl', }, { url => 'http://tt2.org/', title => 'Template Toolkit', }, # ...and so on... ] }; # process template - output to STDOUT by default $tt->process('example.html', $data) || die $tt->error();