Hello,
I am trying to assign a value from outer loop to a var in inner loop by
turning global_vars ON in new() but without success. The one in the
outer loop is getting set fine though. Here is the code snippet:
<tmpl_loop name=qLoop>
<tr>
<td colspan=2>
<tmpl_var name=id>. <tmpl_var name=question>
</td>
</tr>
<tr>
<tmpl_loop name=chLoop>
<td width="50%">
<input type="radio" name="<tmpl_var name=id>"
value=""> <tmpl_var name=choice>
</td>
<tmpl_unless __odd__>
</tr>
<tr>
</tmpl_unless>
</tmpl_loop> <!-- chLoop -->
</tr>
</tmpl_loop> <!-- qLoop -->
=================================================
my @qLoop = ();
foreach my $q (@qData) {
my %qRow;
$qRow{id} = $q->{id};
my @chLoop = ();
foreach (@choices) {
my %ch;
$ch{choice} = $_;
push (@chLoop, \%ch);
}
$qRow{chLoop} = \@chLoop;
push(@qLoop, \%qRow);
}
$template->param(qLoop => \@qLoop);
=======================================================
Here is the new() call:
my $template = HTML::Template->new(filename => $htmlFile,
filter => $filter,
global_vars => 1,
loop_context_vars => 1);
I am using $HTML::Template::VERSION = '2.2';
Would appreciate any suggestions.
Thanks
Nishi
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]