in reply to Sending hash to HTML::Template

Use fetchall_arrayref (instead of fetchall_hashref) to get an array of hashes right from the start: (untested)
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>
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.

blokhead