I have the following code in search.cgi script:
while (my $rset = $sth->fetchrow_arrayref) {
push @p, $rset->[0];
push @t, $rset->[1];
push @l, $rset->[2];
push @m, $rset->[3];
}
my $tt2 = Template->new({
INCLUDE_PATH => ['/home/savio/templates/src', '/home/savio/templates/lib'],
});
my $vars = {
p => @array1,
t => @array2,
l => @array3,
m => @array4,
};
$tt2->process('results', $vars) || die $tt2->error();
and the following template in /home/savio/template/lib/results:
[% rset = [ p, t, l, m ] %]
[% FOREACH value = [1..rset.size] %]
<h5>Project: [% rset.0.p %]</h5>
<label>Type: [% rset.1.t %]</label><br/>
<label>language: [% rset.2.l %]</label><br/>
<label>Members: [% rset.3.m %]</label><br/>
[% END %]
but I doesn't able to pass rset values trought $vars in template.
What is the problem?
How can I to obtain to fill template values?
Best regards,
savio
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates