Re: [htmltmpl] new work on HTML::Template
Brought to you by:
samtregar
From: Brad B. <bm...@ma...> - 2011-04-07 00:41:15
|
On Wed, Apr 6, 2011 at 8:28 PM, Lyle <web...@co...> wrote: > For further clarification, and without looking at the H::T implementation. > You are calling it an object because in the sense of the term 'object' the > template is an object. But, it's not a Perl object, which is likely where > further confusion comes from. Yes, it is a Perl object. A "template" is a bunch of text. An HTML::Template object is a Perl object ... new() Call new() to create a new Template object: my $template = HTML::Template->new( filename => 'file.tmpl', option => 'value' ); ... output() output() returns the final result of the template. In most situations you'll want to print this, like: print $template->output(); .. Calling output() is guaranteed not to change the state of the Template object, in case you were wondering. This property is mostly important for the internal implementation of loops. ---- http://search.cpan.org/dist/HTML-Template/Template.pm |