sub some_runmode { my $self = shift; my $foo = $self->param('Foo'); my $template = $foo->template("some_template.tmpl"); # ... # do some stuff and pass other params to the template # ... return $template->output(); } #### Error executing run mode 'some_runmode'. Eval of code '$self->some_runmode' resulted in error: HTML::Template->new() : Unknown or unmatched TMPL construct at templates/some_template.tmpl : line 1. at /usr/lib/perl5/site_perl/5.8.0/HTML/Template.pm line 2130.