in reply to Perl variable names stored in mysql fields
Use HTML::Template or other templating system:
use strict; use warnings; use HTML::Template; my $headerStr = 'Perl variable names stored in mysql fields'; my $str =<<HTML; <HTML> <HEAD> <title><TMPL_VAR NAME=TITLE></title> ... some other header information, such as javascripts ... </HEAD> <BODY> HTML my $template = HTML::Template->new(scalarref => \$str); $template->param(TITLE => $headerStr); print "Content-Type: text/html\n\n", $template->output ();
Prints:
Content-Type: text/html <HTML> <HEAD> <title>Perl variable names stored in mysql fields</title> ... some other header information, such as javascripts ... </HEAD> <BODY>
|
|---|