Looking for Template::Perl


Joseph Polanik <jpolanik27@...>
 

I would like to use the [% PERL %] directive described in the manual (http://template-toolkit.org/docs/manual/Directives.html#section_PERL). However, the manual goes on to say "Perl code is evaluated in the Template::Perl package" and I apparently don't have that (because the "[% PERL %]" block appears as a string literal in the page source when the template is rendered).

This package isn't listed on CPAN, so I'm wondering if someone can tell me where it might be found.

Thanks,

Joe Polanik


Dave Cross
 

On Sat, 10 Oct 2020, 17:49 Joseph Polanik, <jpolanik27@...> wrote:
I would like to use the [% PERL %] directive described in the manual (http://template-toolkit.org/docs/manual/Directives.html#section_PERL). However, the manual goes on to say "Perl code is evaluated in the Template::Perl package" and I apparently don't have that (because the "[% PERL %]" block appears as a string literal in the page source when the template is rendered).

This package isn't listed on CPAN, so I'm wondering if someone can tell me where it might be found.

Template:: Perl isn't a module. It's the name of an internal namespace that TT uses when running code within a [% PERL %] directive. There's nothing to install.

It's far more likely that your Perl code isn't being evaluated because you've forgotten to include EVAL_PERL => 1 when configuring your Template object.

Dave...