Re: [htmltmpl] Erro: You gave me an odd number of parameters to param()!
Brought to you by:
samtregar
From: Brad C. <bra...@hi...> - 2004-09-11 17:18:27
|
> On Fri, Sep 10, 2004 at 02:11:03PM -0500, Brad Cathey wrote: >>> >>> you passed the array instead of the array reference >>> >>>> $template -> param(pagetitle => "Search Results", >>>> showlist => @$allshows); >>> ^^^^ >>> >>> this is probably the correct one: >>> >>> $template -> param(pagetitle => "Search Results", >>> showlist => $allshows); >> >> Well, now I get: >> >> "Single reference arg to param() must be a hash-ref! You gave me a ARRAY" >> >> I guess I don't know how to go from @$array to $array as a ref. A Perlie >> question. Maybe I need to head over to the Monastery. >> >> Again, the salient code is: >> >> my $allshows; >> >> push @$allshows, $sth->fetchall_arrayref({}); >> >> $template -> param( showlist => $allshows); > > I thought this was the same thing, but try using \@$allshows; maybe > there is some Perl conversion rule I don't understand causing $allshows > to be expanded to the array in a parameter context. > > For similar template loop vars I have, for instance, > > $template->param( "USERLIST_COL1", \@list ); > > but in this case the list was declared as an array rather than an array > ref. > -- Clifton Clifton, amazing. I added the slash and was golden. Thanks. |