use strict; use warnings; use HTML::Template; my $headerStr = 'Perl variable names stored in mysql fields'; my $str =< <TMPL_VAR NAME=TITLE> ... 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 (); #### Content-Type: text/html Perl variable names stored in mysql fields ... some other header information, such as javascripts ...