On 05/03/2010 04:43, Jim Battle wrote:
> Question #1:
> what is the mechanism to add another directory for searching for plugins?

ttree --perl5lib c:\path\to\lib

> Question #2:
>
> [% PERL %]
>       sub mycrunch {
            ...
>       }
> [% END %]

Code written in a PERL block gets re-evaluated each time it is run.
So the mycrunch() subroutine is being re-defined each time and not
having any lasting effect.  Hence the "subroutine redefined" warnings.

> C:\websites\generate>build_html.bat
>     + basic-2.html
>     + basic_comparison.html
> Subroutine mycrunch redefined at (eval 24) line 3.
>     + cpus.html
> Subroutine mycrunch redefined at (eval 26) line 3.
>     + css/site.css
>       ...

The RAWPERL directive is closer to allowing you to embed raw Perl in a
template.  Your example *may* work if you just change PERL to RAWPERL,
but to be honest, you're much better off writing it as a separate
plugin, or in Perl program that launches TT.

> Thanks again for your help and patience.

You're welcome.  Hope that answers your questions.

A


_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to