mhearse has asked for the wisdom of the Perl Monks concerning the following question:
Update: I changed the template VAR_NAMES and got it working. I'm still not able to figure out why the original case is broken.
Update (again): The problem was the lack of quoting the VAR_NAMEs.
### Contents of test.tmpl#!/usr/bin/perl use strict; use HTML::Template; my $tmpl_obj = HTML::Template->new( filename => 'test.tmpl', case_sensitive => 1, ); $tmpl_obj->param( OUTER_LOOP => [ { MENU_NAME => "GONZO", INNER_LOOP => [ { SUBSCRIPT_ACTION => "javascript://", SUBSCRIPT_NAME => "test1", }, { SUBSCRIPT_ACTION => "javascript://", SUBSCRIPT_NAME => "test2", }, { SUBSCRIPT_ACTION => "javascript://", SUBSCRIPT_NAME => "test3", }, ], }, ], ); print $tmpl_obj->output();
<ul id="sddm"> <TMPL_LOOP NAME=OUTER_LOOP> <li><a href="#" onmouseover="mopen('m1')" onmouseout="mclosetime()"><TMPL_VAR NAME=MENU_NAME></a> <div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()"> <TMPL_LOOP NAME=INNER_LOOP> <a href=<TMPL_VAR NAME=SUBSCRIPT_ACTION>><TMP_VAR NAME=SUBSCRI +PT_NAME></a> </TMPL_LOOP> </div> </TMPL_LOOP> </ul> <div style="clear:both"></div>
|
|---|