#!/usr/bin/perl -w use strict; use CGI; use Template # ... my $q = CGI->new; # ... $template->process("foo.tmpl.html", { query => $q, @other_variables, }) or die $Template::ERROR;