[htmltmpl] Erro: You gave me an odd number of parameters to param()!
Brought to you by:
samtregar
From: Brad C. <bra...@hi...> - 2004-09-10 17:45:54
|
Fellow H::Ters, Never got this error before. "HTML::Template->param() : You gave me an odd number of parameters to param()!" The only thing I can think of is that my AoH is wrong but Data::Dumper shows: $VAR1 = [ { 'id' => '6', 'teaser' => 'Domestic violence has been called a serious health crisis.', 'title' => 'Battered and Broken', 'number' => '214' } ]; Ideas?? Thanks in advance, Brad -------------------------------------------- Here's my Perl (and yes, Data::Dumper shows all variables have values): for my $i ( 0 .. $#ids ) { $stmt = "SELECT id,title,teaser,number FROM shows WHERE id = '$ids[$i]' ORDER BY number"; &execute_it( $stmt ); #db operations to grab all matches push @$allshows, $sth->fetchall_arrayref({}); } $template = HTML::Template->new(filename => 'showslisting.tmpl', die_on_bad_params => 0); $template -> param(pagetitle => "Search Results", showlist => @$allshows); ------------------------------------------- Here's my HTML <h1><tmpl_var pagetitle></h1> <tmpl_if showlist> <tmpl_loop showlist> <h4><a href="cgi-bin/showsum.pl?id=<tmpl_var name='id'>"> <tmpl_var name='title'></a></h4> <p><i>Show number:</i> <b><tmpl_var name='number'></b></p> <p class="spcb"><tmpl_var name='teaser'></p> </tmpl_loop> <tmpl_else> <p class="spcb">No shows matched.</p> </tmpl_if> |