加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

安装使用template toolkit

发布时间:2020-12-16 00:03: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

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

使用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::ERRORn";
 
my $vars = {
	name     => 'Wayne',email     => 'prosmarter@163',deadline => 'the next chorus',};

$tt->process('hi.html',$vars) || die $tt->error(),"n";

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读