安装使用template toolkit

来源:互联网 发布:linux系统各种下载 编辑:程序博客网 时间:2024/04/18 22:50

tt是一个perl模块,一个出色的模版引擎

使用perl 自带的cpan安装

perl -MCPAN -e shellinstall 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";




0 0
原创粉丝点击