Hello,
I am trying to process a template that is stored in a TT variable. However,
I can't get it to work. Is it possible? I have included a little program to
demonstrate what I am trying to do:
#!/usr/bin/perl -w
use strict;
use Template;
my $t = new Template;
my $embeddedTemplate = q(
[% FOREACH i = [ 1 .. 10 ] %]
i = [% i %]
[% END %]
);
# Ideally, $mainTemplate would process the template that is stored in
# embTemplate, but, alas, it does not. :-(
my $mainTemplate = '[% PROCESS embTemplate %]';
$t->process(\$mainTemplate, { embTemplate => $embeddedTemplate, })
or die $t->error();
As is, this program results in this error:
file error - embTemplate: not found
I understand that it is looking for a template called embTemplate, so I
changed $mainTemplate to '[% PROCESS $embTemplate %]'. This, as you probably
already know, didn't work either.
Any suggestions would be much appreciated.
Regards,
Travis Spencer
Portland, OR USA
__o
_-\<,
(_)/(_)____
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates