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

I don't understand your point, definitely not loading the wrong template, using CGI::Application for this as well. You can see on the code that "test" has been declared in the .tmpl and called in the perl file. The template gets called as:
my $template = $self->load_tmpl('mytemp.tmpl');

Replies are listed 'Best First'.
Re^3: IF in a loop using HTML::Template
by Anonymous Monk on Mar 20, 2013 at 19:24 UTC

    I don't understand your point,

    Turn on debugging , and figure out where the problem is. The code you posted is not complete, I can't run it and figure it out for you.

      OK here is something that illustrate my issue:
      #!/usr/bin/perl use strict; use warnings; use HTML::Template; my $t=HTML::Template->new(filename=>'temp.tmpl'); my @foo=({bar=>1,baz=>2},{bar=>3,baz=>4}); $t->param(foo=>\@foo); my $test = 1; my $message = 'Yes there is' if $test; $t->param(TEST => $message ); print $t->output;
      and . tmpl file
      <tmpl_loop name="foo"> <tmpl_var name="bar"> <tmpl_var name="baz"> <TMPL_IF NAME="TEST"></TMPL_IF> </tmpl_loop>
      I hope someone can help!