my $q = new CGI(); my $template = new HTML::Template( ... ); my $html = $template->output(); my $fif = new HTML::FillInForm; my $output = $fif->fill(scalarref => \$html, fobject => $q);