my $tpl = HTML::Template->new(); my $q = CGI->new(); $tpl->param( 'file' => $q->param('file') ); # Then in your template ####