sub show_record { my $self = shift; my $cgi = $self->query(); my $emp_no = $cgi->param("emp_no"); ... # code to access the database omitted ... my $emp_rec = $sth->fetchrow_hashref; ... # code to fiddle with the data omitted ... my $template = $self->load_tmpl(emp_detail.tmpl.html'); $template->param( $emp_rec ); return $template->output; }