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(); }