http://www.perlmonks.org?node_id=1003912

unlinker has asked for the wisdom of the Perl Monks concerning the following question:

Venerable Monks,

Is it possible to process a TT template so that only the INCLUDE (or the INSERT) directives are processed? For example if my template (say outer.tt) is :

Hi [% name %], Some Text here.... [% INCLUDE inner.tt %] Some more text here.....
and inner.tt is:
Product ID: [% product_id %]
I would like to generate the template string:
Hi [% name %], Some Text here.... Product ID: [% product_id %] Some more text here.....

so that only the INCLUDE directive is processed and a new template is generated?

Many Thanks...