#!/usr/local/bin/perl

use strict ;
use warnings ;

use Template::Simple ;

my $tmpl = Template::Simple->new() ;

$tmpl->add_templates( { ddd => <<DDD } ) ;
text1
[%START nest%]
	BAR is [%bar%]
[%END nest%]
DDD

my %data = (
	ddd	=> [
		{
			nest	=> {
				bar => 'xxx',
			},
		},
		{
			nest	=> {
				bar => 'yyy',
			},
		},
		{
			nest	=> {
				bar => 'zzz',
			},
		},
	],
) ;

$tmpl->compile('foo') ;
#$tmpl->compile('fooz') ;

#my $rendered = $tmpl->render('foo', { foo => 2, bar => 'xxx' } ) ;

#print "REND [$$rendered]\n" ;

$tmpl->compile('ddd') ;
my $rendered = $tmpl->render( 'ddd', $data{ddd} ) ;

print "REND [$$rendered]\n" ;

print $tmpl->get_source( 'ddd' ) ;

exit ;
