use strict;
use warnings;
use HTML::Template;
my $headerStr = 'Perl variable names stored in mysql fields';
my $str =<
... some other header information, such as javascripts ...
HTML
my $template = HTML::Template->new(scalarref => \$str);
$template->param(TITLE => $headerStr);
print "Content-Type: text/html\n\n", $template->output ();