# temp.pl ... sub my_calls { my $self = shift; my $q = $self->query; my $name = $q->param('name'); my $sql = "select * from my_taable where name = ?"; my $alldata = $self->_get_data($sql, $name); my $template = $self->load_tmpl('mytemp.tmpl'); $template->param('data', $alldata ); $template->param('test' => 1); return $template->output(); } ...