http://www.perlmonks.org?node_id=883507


in reply to Re: HTML::Template how to use IF/Else in a LOOP
in thread HTML::Template how to use IF/Else in a LOOP

and since one might avoid globals vars also in templates (I do): you might try HTML::Template::Compiled, where you can activate global vars partly (see "global_vars" in the OPTIONS section) - it allows you to "navigate" up the data structure, so <TMPL_VAR ..foo> will get you the var foo directly one level above (and 3 dots will go two levels up and so on (notice also that one dot goes to the root level, and for that you don't even need to set global_vars)).
  • Comment on Re^2: HTML::Template how to use IF/Else in a LOOP