in reply to Re: HTML::Template nested loops, DBI/MySQL and map
in thread HTML::Template nested loops, DBI/MySQL and map
I was going to ask about passing the statement handle around - it didn't feel right. Neatly solved.
I also agree that a for loop is now easier to read than the map. Again, many thanks.
sub get_category_loop { my @cat_loop_hrefs = @{ $dbh->selectall_arrayref( sql_category(), {Slice => {}} ) }; for my $cat_href (@cat_loop_hrefs){ $cat_href->{subject_loop} = get_subject_loop(delete $cat_href->{category_id}); } return [@cat_loop_hrefs]; }
|
|---|