Second glance:

On Tue, 15 Oct 2002, Dermot Paikkos wrote:
>
> (my @data) = &getusers();
> ....
> sub getusers {
> ......
>   while (my ($id,$name,$surname) = $sth->fetchall_arrayref) {
>         return $id,$name,$surname;
>         }
> }

The following should do the trick, assuming that @$data is an array of
lots of hrefs of id, name, surname.. :

sub getusers
{
  my @results;
  while (my ($id, $name, $surname) = $sth->fetchall_arrayref))
        {
        push @results, {id=>$id, name=>$name, surname=>$surname}
        ...
        }
  return \@results;
}

$t->process ($path, {data=>getusers});




-- 
Senior Programmer
Bookings.nl
----------------------------------------------------------
Me::[EMAIL PROTECTED]||www.dreamthought.com
Budget hosting on my 10Mbit/backbone::[EMAIL PROTECTED]



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates

Reply via email to