How to just compile templates in Template::Toolkit?

241 views Asked by At

What's the best way to 'compile only' (so to their Perl compiled version) templates for template toolkit.

So far I've called ->process on them, but as it really execute the templates, that's far from ideal.

Ideally I'd like to 'just compile' templates to their Perl version without evaluating them.

1

There are 1 answers

1
AKHolland On BEST ANSWER

As documented on CPAN, it is possible like so:

my $tt = Template->new;
my $templateFile = "something.html";
my $compiledTemplate = $tt->template($templateFile);