#!/usr/bin/perl my $t=new HTML::Template; foo($t); print $t->output; sub foo { my $f=shift; $f->param(foo=>baz); }