Workshop: Introduction To Template::Toolkit

By Duncan Garland from
Date: Saturday, 30 November 2013 09:30
Duration: 120 minutes
Target audience: Beginner
Language: English

5m Intro
10m Talk on TT
15m Exercises
10m Talk on TT
10m Exercises

This workshop is aimed at beginners. No knowledge of Template::Toolkit is assumed. You can probably get away with little or no knowledge of Perl, but I think you'll struggle if you haven't got any knowledge of programming at all.

The Template::Toolkit is a presentation language which allows you to separate the presentation aspects from the rest of the application. In web development this normally means separating the HTML and the styling from the heavy database accessing and data manipulation.

In the first 10 minute taught section I'll go through some slides. I'll take a simple mail-merge type letter with a few placeholders for "name" and the like. Then I'll gradually add some flow control, some boolean logic and show how to embed templates within other templates.

In the 15 minute "lab" section I'll give you some exercises which illustrate the points covered. I'll provide semi-completed Perl scripts so that you can concentrate on the templating.

In the second taught session, I'll show how to use a wrapper to add a standard header and footer. I'll show some slightly more complex data structures. I show how filters can be used for encoding HTML and vmethods to sort lists or count elements.

In the final lab session I'll provide some more exercises.

That's all we'll have time for. We'll have only scratched the surface of Template::Toolkit. There is an excellent O'Reilly book,, and a wealth of documentation on CPAN,

PS. The 2013 workshop will have 2 more 15 minute taught session and two more labs. I'll flesh out the content shortly.

Attended by: lavanya palayil,



Active Securities


Bytemark Hosting

CV Library




magnum Solutions


Net-A-Porter Group


Petamem logo

Science Photo Library

      Systems Limited


Enlightened Perl Organisation

Perl6 Community

The Perl Foundation