I have read the POD on HTML::Template several times now, and the POD on DBI/DBD::MySQL in the attempt to use the fetchall_arrayref() method from the DBI to feed a template loop. Is this indeed possible - or do I actually have to manually loop through the 30 or more records to build the array reference of hash references that Template loop is wanting?
example of what i THINK the DBD is returning (and appearantly is NOT working with Template):
my @loop_data=(); $loop_data=[ {Auction=>'Test1', ID=>'1'}, {Auction=>'Test2', ID=>'2'}, {Auction=>'Test3', ID=>'3'}, {Auction=>'Test4', ID=>'4'}, ]; $template->param(table1 => \@loop_data);
the same code DOES work with:
my @loop_data=(); my %rowdat; $rowdat{Auction}='Test1'; $rowdat{ID}='1'; push(@loop_data, \%rowdat); $template->param(table1 => \@loop_data);
Or the iterative version thereof. What obvious thing am I missing - or is it just not possible and I am beating my head on a stone wall?
Thanks in advance for any help on this, my first posting.
Edit - Petruchio Sat Oct 20 02:36:36 UTC 2001: Added markupIn reply to By ref or by ..well..ref! by growlf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |