# open the HTML template
my $template = HTML::Template->new(filename => $f_name);
# fill in some parameters in the template
$template->param(Number => $Number);
$template->param(new => $new);
$template->param(story => $story);
$template->param(id_no => $id_no);
$template->param(message_no => $message_no);
if (($check == '0') or ($check == '3') or ($check == '4')) {
$template->param(tart => $tart);
$template->param(ear => $ear);
$template->param(mouth => $mouth);
}
# print the template to file
print $template->output;
####
if (($check == '0') or ($check == '3') or ($check == '4')) {
$template->param(tart => $tart);
$template->param(ear => $ear);
}
if (($check == '0') or ($check == '4')) {
$template->param(mouth => $mouth);
}