while($ref = $sth->fetchrow_hashref()) { $template->param(EVENT_ID => $ref->{'event_id'}); $template->param(NAME => $ref->{'name'}); print $template->output; };