in reply to Re^3: IF in a loop using HTML::Template
in thread IF in a loop using HTML::Template

Thank you all, now back to the drawing board!
  • Comment on Re^4: IF in a loop using HTML::Template

Replies are listed 'Best First'.
Re^5: IF in a loop using HTML::Template
by saberworks (Curate) on Mar 21, 2013 at 00:41 UTC
    You don't need to go back to the drawing board, just set the global_vars option as quoted above:
    If you want your variables to be global you can use global_vars option to new() described below.
    From the docs:
    global_vars - normally variables declared outside a loop are not available inside a loop. This option makes <TMPL_VAR>s like global variables in Perl - they have unlimited scope. This option also affects <TMPL_IF> and <TMPL_UNLESS>.