Text::Xslate::Syntax::TTerse - An alternative syntax like Template-Toolkit 2
use Text::Xslate; my $tx = Text::Xslate->new( syntax => 'TTerse', string => 'Hello, [% dialect %] world!', ); print $tx->render({ dialect => 'TTerse' });
TTerse is a subset of the Template-Toolkit 2 syntax, using [% ... %] tags.
[% ... %]
[% var %] [% var.0 %] [% var.field %] [% var.accessor %]
Variables may be HASH references, ARRAY references, or objects.
[% FOREACH item IN arrayref %] * [% item %] [% END %]
[% IF expression %] This is true [% ELSE %] Tis is false [% END %] [% IF expression %] Case 1 [% ELSIF expression %] Case 2 [% ELSE %] Case 3 [% END %]
(TODO)
Not supported.
Text::Xslate
Template::Toolkit
Template::Tiny
To install Text::Xslate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Xslate
CPAN shell
perl -MCPAN -e shell install Text::Xslate
For more information on module installation, please visit the detailed CPAN module installation guide.