Scalable template engine for Perl5
Perl XS C Other
Latest commit c373f89 Oct 21, 2016 @syohex syohex committed on GitHub Merge pull request #168 from dallaylaen/master
DOC Add an extra newline before =head1 SEE ALSO

NAME Build Status

Text::Xslate - Scalable template engine for Perl5


use Text::Xslate;

my $tx = Text::Xslate->new();

my %vars = (
    title => 'A list of books',
    books => [
        { title => 'Islands in the stream' },
        { title => 'Programming Perl'      },
        # ...

my $template = q{
<h1><: $title :></h1>
: for $books -> $book {
    <li><: $book.title :></li>
: } # for

print $tx->render_string($template, \%vars);


Install cpanm (App::cpanminus) and then run the following command to install Xslate:

$ cpanm Text::Xslate

If you get the distribution, unpack it and build it as per the usual:

$ tar xzf Text-Xslate-{version}.tar.gz
$ cd Text-Xslate-{version}
$ perl Makefile.PL
$ make && make test

Then install it:

$ make install

If you want to install it from the repository, you must install authoring tools.

$ cpanm < author/requires.cpanm


Text::Xslate documentation is available as in POD. So you can do:

$ perldoc Text::Xslate

to read the documentation online with your favorite pager.


web site:
issue tracking:


Copyright (c) 2010, Fuji, Goro (gfx). All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.