- or download this
<form action="color.pl" method="post">
<p>Your name: <input type="text" name="name"
...
value="<TMPL_VAR NAME=COLOR>"></p>
<p><input type="submit"></p>
</form>
- or download this
<p>Hello, <b><TMPL_VAR NAME=NAME></b>. A little
birdy told me your favorite color is <b><TMPL_VAR NAME=COLOR></b>.
- or download this
use CGI;
use HTML::Template;
...
my $t = HTML::Template->new(filename => "$template.tmpl", associate =>
+ $cgi);
print $t->output;
- or download this
use DBI;
use CGI;
...
print $cgi->header;
print $t->output;
- or download this
<table border="1">
<tr><th>ID</th><th>NAME</th><th>PRICE</th></tr>
...
</TMPL_LOOP>
</table>
- or download this
[snip]
...
}
$t->param(ROWS => $rows, TOTAL => $sum);
- or download this
<table border="1">
<tr><th>ID</th><th>NAME</th><th>PRICE</th></tr>
...
</table>
<p>The total is <TMPL_VAR NAME=TOTAL></p>
- or download this
use DBI;
use CGI;
...
print $t->output;
$dbh->disconnect;