Text::Template::Compact

Text base template expand module
Download

Text::Template::Compact Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • tateisu
  • Publisher web site:
  • http://search.cpan.org/~tate/

Text::Template::Compact Tags


Text::Template::Compact Description

Text base template expand module Text::Template::Compact is a text base template expand module. This module compile control tag in source text and output it with parameter data that gived at runtime. Its main purpose is handling HTML templates in Web Application, but it also available for other situation such as mail,XML,etc,.SYNOPSIS use utf8; use Encode; use Text::Template::Compact; # create instance my $tmpl = new Text::Template::Compact(); # load from file $tmpl->loadFile('template.html','utf8') or die $tmpl->error; # or load from text $tmpl->loadText('src1','hello, ${world}!','utf8') or die $tmpl->error; # prepare binding parameter my $param = { world=>'World' }; # set default filter that used when output parameter or expression $tmpl->filter_default('html'); # set encoding that used when read non-utf8 value from parameter. $tmpl->param_encoding('cp932'); # set string that used for print instead of undefined value. $tmpl->undef_supply('(null)'); # print to filehandle $tmpl->print($param,\*STDOUT,'utf8'); # or get string output print Encode::encode('utf8',$tmpl->toString($param)); Requirements: · Perl


Text::Template::Compact Related Software