in reply to Re: Re: HTML::Template output to file
in thread HTML::Template output to file

According to the docs, the desired syntax for your application is
$template->output(print_to => \*FILE);

In general, the syntax for named parameters is

func(name => $value, ...); $obj->method(name => $value, ...);
optionally with a hyphen in front of the name, which makes it look like a command line option (and which should ring the "familiarity" bell); and which makes it stand out a little more:
func(-name => $value, ...); $obj->method(-name => $value, ...);
In case you find this baffling: the autoquoting rule for the left hand side of "=>" also applies to barewords preceded with a hyphen. So, (-name => 'value') is interpreted by Perl as ('-name', 'value').

But, from the source I would gather that HTML::Template doesn't honour this tradition, by which I mean it likely won't recognize $template->output(-print_to => \*FILE); . However, I musty admit I haven't tested it.