X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=samples%2Fmemory_template.pl;fp=samples%2Fmemory_template.pl;h=6b03cdf39e08ff60d39214a47e2ec3d68ea3fee8;hb=d710d6cd21be21c0ab2df3566c2bd61d9015cac6;hp=28b17105331b72f6328abd0bb60894ba259827a8;hpb=d2b7c937e86e6e8c4b4193e9f4a8da075919b4fd;p=chaz%2Fp5-CGI-Ex diff --git a/samples/memory_template.pl b/samples/memory_template.pl index 28b1710..6b03cdf 100644 --- a/samples/memory_template.pl +++ b/samples/memory_template.pl @@ -10,6 +10,7 @@ my $swap = { }; my $txt = "[% one %][% two %][% three %][% hash.keys.join %] [% code(one).length %] [% hash.\$a_var %]\n"; +#$txt = hello2000(); ###----------------------------------------------------------------### @@ -37,3 +38,26 @@ sleep 15; # go and check the 'ps fauwx|grep perl' ###----------------------------------------------------------------### + +sub hello2000 { + my $hello2000 = "[% title %] +[% array = [ \"Hello\", \"World\", \"2000\", \"Hello\", \"World\", \"2000\" ] %] +[% sorted = array.sort %] +[% multi = [ sorted, sorted, sorted, sorted, sorted ] %] + +[% FOREACH row = multi %] + + [% FOREACH col = row %] + + [% END %] + +[% END %] +
[% col %]
+[% param = integer %] +[% FOREACH i = [ 1 .. 10 ] %] + [% var = i + param %]" + .("\n [%var%] Hello World Hello World Hello World Hello World Hello World Hello World Hello World Hello World Hello World Hello World
"x20)." +[% END %] + +"; +}