Tuesday, March 27, 2007

パラメータの値をそのまま Template Toolkit

#!/usr/local/bin/perl

use strict;
use Template;
use CGI;
my $q = CGI->new;
print "Content-type: text/html\n\n";
my $output;
my $template = Template->new({
OUTPUT => \$output,
TRIM =>1,
});


$template->process(
'sample2.html',
{ cgi =>$q,
},
) or print $template->error;

print $output;




$q->param("money","dollar");

-----template---

[% cgi.param('money') %]

No comments: