On 15/03/2013 01:13, Philippe Bruhat (BooK) wrote:
My question is: did I overlook a simpler way to do this?

You can use the BLOCKS configuration item to define templates up front:

  http://template-toolkit.com/docs/manual/Config.html#section_BLOCKS

e.g.

  my $tt = Template->new(
      BLOCKS => {
          t1 => '[% INCLUDE t2 %]',
          t2 => '[% foo %]',
      }
  );

  $tt->process(\"t1: [% INCLUDE t1 %]", { foo => 3.14 })
      || die $tt->error;


Cheers
A


_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to