in reply to HTML::Template::Compiled - TMPL_EACH
#!/usr/bin/perl -- use strict; use warnings; use HTML::Template::Compiled; { my $htc = HTML::Template::Compiled->new( scalarref => \'<%each foo%>key <%= __key__ %>=<%= __value__ %> <%/each%>', debug => 0, loop_context_vars => 1, ); $htc->param(foo => { a => 1, b => 2, c => 3 }); my $out = $htc->output; print $out,$/; } { my $htc = HTML::Template::Compiled->new( scalarref => \'<TMPL_EACH foo>key <TMPL_VAR __key__ >=<TMPL_VA +R __value__> </TMPL_EACH>', debug => 0, loop_context_vars => 1, ); $htc->param(foo => { a => 1, b => 2, c => 3 }); my $out = $htc->output; print $out,$/; } __END__ key c=3 key a=1 key b=2 key c=3 key a=1 key b=2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML::Template::Compiled - TMPL_EACH
by moritz (Cardinal) on Sep 05, 2008 at 07:08 UTC |