package Foo; sub new { return bless ( { count => 1 } ) } sub count { $_[0]->{count}++ } 1; #### use Foo; use Template; my $template = Template->new(); $template->process( \*DATA, { bar => Foo->new() } ) || die "Cannot process: ", $template->error(), "\n"; __DATA__ I am calling methods on the object named 'bar': Call: [% bar.count %] Call: [% bar.count %] Call: [% bar.count %] #### I am calling methods on the object named 'bar': Call: 1 Call: 2 Call: 3