Dermot Paikkos wrote:
> (my @data) = &getusers();
>
> sub getusers {
> .....
> while (my ($id,$name,$surname) = $sth->fetchall_arrayref) {
I think you want to do this:
my $vars = {
data => $sth->fetchall_arrayref({}),
};
By default, fetchall_arrayref() returns a reference to an array of
records, each of which is a reference to an array of fields.
If you pass an empty hash reference as an argument, you still get a
reference to an array returned, but each element is a reference to
a hash of fields.
Then you should be able to do this:
[% FOREACH item = data %]
[% item.id %] [% item.name %]
[% END %]
A
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates