Scalable template engine for Perl5.

What is Xslate?

Xslate is a template engine for Perl5 with the following features:

  • The fastest in CPAN - Up to 50~100 times faster than TT2! (see the benchmarks for more info)
  • Support for multiple template syntaxes - TT2 compatible syntax, for example
  • Easy to enhance - by importing subroutines and/or by calling object methods
  • Safe - Escapes HTML meta characters by default
  • Debuggable - Readable error messages with correct line numbers

Getting started

Install cpanminus and then run the following command to install Xslate.

$ cpanm Text::Xslate

Introduction to Xslate

See "Quick introduction to Xslate"

Template code

: # in Kolon, the default syntax
: for ["Xslate"] -> $lang {
Hello, <: $lang :> world!
: }
[%# in TTerse, a TT2 compatible syntax -%]
[% FOR lang IN ["Xslate"] -%]
Hello, [% lang %] world!
[% END -%]
{* in Clevery, a Smarty compatible syntax *}
{foreach from=`["Xslate"]` item=lang}
Hello, {$lang} world!

What People Say



Related modules