> HTML::Template->output() : fatal error in loop output : Can't coerce array
> into hash at /usr/lib/perl5/site_perl/5.6.1/HTML/Template.pm line 2726.
> at itemtype_list.cgi line 64
> my $rows = $dbh->selectall_arrayref("
> SELECT *
> FROM producttypes
> ORDER BY producttype
> ", \%attr);
> $template->param(ITEMLIST => $rows);
Humm.
$rows has an array referance continaing an array referance of each rows
data, not an array of hash referances.
for a tmpl_loop template->param requires a hashref of
[ varname => value, .....]
so you need a loop between reading the values from the database to push
I do my loops look something like this.
while ($row = $sth->fetchrow_hashref("NAME_uc") ) {
my $href = {};
$href->{resources_resid} = $row->{RESID};
$href->{resources_name} = $row->{NAME};
$href->{resources_description} = $row->{DESCRIPTION};
if ($row->{SYSTEM_UNAVAILABLE}) { $sys_unavailable = "Some of your resources
have been marked as unavailable by the system because your account has
expired. Please go to the 'My Account' and select 'Service Level' to upgrade
your account";}
push @data, $href ;
$lines--;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]