... code to setup my $t template, and get info from the database into %fdat would be here ... my $html = $t->output; if ( %fdat ) { my $fif = new HTML::FillInForm; $html = $fif->fill(scalarref => \$html, fdat => \%fdat ); } return $html; # this is the filled-out HTML file