in reply to Sending hash to HTML::Template
You can also combine the prepare/execute/fetchall_arrayref into a single call to selectall_arrayref, if you use the Slice parameter. This is the simplest way to send query results directly into HTML::Template. Take a look at the excellent DBI recipes for more info.my $rows = $sth->fetchall_arrayref({}); $_->{nw} = addComma( $_->{nw} ) for @$rows; $tmpl->param( items => $rows ); ## Suitable for: ## ## <tmpl_loop items> ## <tmpl_var name> ## <tmpl_var nw> ## <tmpl_var number> ## </tmpl_loop items>
blokhead
|
|---|