Re: [htmltmpl] html template loops (hash of a hash)
Brought to you by:
samtregar
From: Karen <kar...@gm...> - 2006-08-30 20:11:55
|
On 8/30/06, Covert, Jake (JSC.) <jco...@fo...> wrote: > Don't think this is a Perl error, so I'm thinking it's an HTML::Template > error, maybe. Yep, it's actually a Perl error. It's complaining about "@{$vendor_hoh{$vendor}}" in line 85: > 85 my ($rif, $rif_out, $graph, $raw, $percent1, $percent2, $percent3) > = @{$vendor_hoh{$vendor}}; Whatever's in $vender_hoh{$vendor}, it's not an arrayref. The problem is earlier in your code. Once %vendor_hoh is populated correctly, your code should work fine, though you could shorten it thus (assuming I haven't made any brainos): $tmpl->param( TMPL_LOOP, [ map { rif => $vendor_hoh{$_}->[0], rif_out => $vendor_hoh{$_}->[1], graph => $vendor_hoh{$_}->[2], raw => $vendor_hoh{$_}->[3], percent1 => $vendor_hoh{$_}->[4], percent2 => $vendor_hoh{$_}->[5], percent3 => $vendor_hoh{$_}->[6], }, sort keys %vender_hoh ] ); |