>From a quick glance:
On Tue, 15 Oct 2002, Dermot Paikkos wrote:
> <tr>
> <td>item1=[% i %]</td><td>item2=[% i.id
> %]</td><td>item3=[% i.name %]</td>
> </tr>
>
> Gives me that:
> item1=ARRAY(0x8368dc4) item2= item3=
Since 'i' is an array reference - the fields i.id and i.name
will not be able to access elements of that array, unless they are:
i) numeric indicies
ii) or 'i' is a hashref
> (my @data) = &getusers();
> ....
> sub getusers {
> ......
> while (my ($id,$name,$surname) = $sth->fetchall_arrayref) {
> return $id,$name,$surname;
> }
> }
Well, getusers returns an array 'return $id, $name, $surname' and thus
array.id, etc will never work.
1) You probably want getusers to return:
return {id=>$id, name=>$name, surname=>$surname};
and then in pass the template:
process ($path, {data=>getusers})
OR
2)
@data =getusers;
just process($path, {data=>{id=>$data[0], name=>$data[1],
surname[2]}});
Type thing..
R.
--
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