I want to be able to include a template component in a template where that component is not a file. I'm sure its somewhere in the man pages, but I can't find it. This is what I tried:
perl code:
use strict;
use Template;
use Template;
my $block = <<BLOCK;
----------------------------------------------
Hello, [% name %]
----------------------------------------------
BLOCK
----------------------------------------------
Hello, [% name %]
----------------------------------------------
BLOCK
my $tt = Template->new() or die;
my $ttData =
{
blockdata => $block,
name => 'John'
};
my $ttData =
{
blockdata => $block,
name => 'John'
};
$tt->process("testblock.tt", $ttData) or die;
testblock.tt:
[% MACRO ablock BLOCK %]
[% blockdata %]
[% END %]
[% blockdata %]
[% END %]
[% INCLUDE ablock %]
Doesn't work. Any ideas?
John Smith
Start your day with Yahoo! - make it your home page
