#!/usr/bin/perl # # hangman3.pl # # CGI script using Template Toolkit Hangman plugin. # use strict; use Template; # may need to tell Perl where to find plugin module use lib qw( /usr/local/tt2/hangman/hangman3/perl5lib ); use constant TEMPLATES => '/home/stas/templates/hangman3'; use constant SHARED => '/usr/local/tt2/templates'; use constant URL => '/cgi-bin/hangman3.pl'; use constant ICONS => '/icons/hangman'; use constant WORDS => '/usr/games/hangman-words'; # create a Template object my $tt = Template->new({ INCLUDE_PATH => [ TEMPLATES, SHARED ], }); # define Template variables my $vars = { url => URL, icons => ICONS, words => WORDS, title => 'Template Toolkit Hangman #3', }; # process the main template $tt->process(\*DATA, $vars) || die $tt->error();