I have been using template toolkit for extending an existing domain specific language(verilog) for over 3 years now. While overall I am happy with it, the major irritant is that
Mojolicious comes with its own templating system Mojo::Template. Its lightweight and can be used even outside of the mojolicious system. Here is an example from the docs:
use Mojo::Template;
my $mt = Mojo::Template->new;
# Simple
my $output = $mt->render(<<'EOF');
% use Time::Piece;
Simple
% my $now = localtime;
Time: <%= $now->hms %>
EOF
say $output;
and another
# More advanced
my $output = $mt->render(<<'EOF', 23, 'foo bar');
% my ($number, $text) = @_;
%= 5 * 5
More advanced
test 123
foo <% my $i = $number + 2; %>
% for (1 .. 23) {
* some text <%= $i++ %>
% }
EOF
say $output;