使用perl 自带的cpan安装
perl -MCPAN -e shell install Template
安装完成
使用
将hi.html放/home/sma/cgi-bin/Tmpl/中
use Template; my $tt = Template->new( { INCLUDE_PATH => '/home/sma/cgi-bin/Tmpl',INTERPOLATE => 1,}) || die "$Template::ERROR\n"; my $vars = { name => 'Wayne',email => 'prosmarter@163',deadline => 'the next chorus',}; $tt->process('hi.html',$vars) || die $tt->error(),"\n";