2 # run with perl -d:DProf $0 ; dprofpp
6 use File::Path qw(rmtree);
8 #use CGI::Ex::Template_60;
10 my $tt_cache_dir = tmpnam;
11 END { rmtree $tt_cache_dir };
12 mkdir $tt_cache_dir, 0755;
14 my $cet = CGI::Ex::Template->new(ABSOLUTE => 1);
16 #my $cet = Template->new(ABSOLUTE => 1);
18 ###----------------------------------------------------------------###
25 hash => {a => 1, b => 2, c => { d => ["hmm"] }},
26 array => [qw(A B C D E a A)],
27 code => sub {"($_[0])"},
32 $txt .= "[% one %]\n";
33 $txt .= ((" "x1000)."[% one %]\n")x100;
34 $txt .= "[%f=10; WHILE (g=f) ; f = f - 1 ; f ; END %]";
35 $txt .= ("[% \"".(" "x10)."\$one\" %]\n")x1000;
40 $file = $tt_cache_dir .'/template.txt';
41 open(my $fh, ">$file") || die "Couldn't open $file: $!";
46 ###----------------------------------------------------------------###
50 $cet->process($file, $swap, \$out);