in reply to HTML::Template - how to handle TMPL_LOOP parameter if no rows returned

You are not doing any bindings or anything in the while loop. Instead of preparing, executing and then fetching one row at a time, your code would be simpler if you used:

my $logged_events = $dbh->selectall_arrayref($loggedEventsSQL);

By doing this you would also get an empty arrayref in case no rows are returned, thus avoiding the error from HTML::Template.

Regards,

Julio

  • Comment on Re: HTML::Template - how to handle TMPL_LOOP parameter if no rows returned
  • Download Code