removing old trexy files
[urisagit/Template-Simple.git] / comp.pl
CommitLineData
540289da 1#!/usr/local/bin/perl
2
3use strict ;
4use warnings ;
5
6use Template::Simple ;
7
8my $tmpl = Template::Simple->new() ;
9
10$tmpl->add_templates( { ddd => <<DDD } ) ;
11text1
12[%START nest%]
13 BAR is [%bar%]
14[%END nest%]
15DDD
16
17my %data = (
18 ddd => [
19 {
20 nest => {
21 bar => 'xxx',
22 },
23 },
24 {
25 nest => {
26 bar => 'yyy',
27 },
28 },
29 {
30 nest => {
31 bar => 'zzz',
32 },
33 },
34 ],
35) ;
36
37$tmpl->compile('foo') ;
38#$tmpl->compile('fooz') ;
39
40#my $rendered = $tmpl->render('foo', { foo => 2, bar => 'xxx' } ) ;
41
42#print "REND [$$rendered]\n" ;
43
44$tmpl->compile('ddd') ;
45my $rendered = $tmpl->render( 'ddd', $data{ddd} ) ;
46
47print "REND [$$rendered]\n" ;
48
49print $tmpl->get_source( 'ddd' ) ;
50
51exit ;