Re: new work on HTML::Template
Brad Baxter <[email protected]> Wed, 6 Apr 2011 20:41:08 -0400
| Newsgroups | gmane.comp.lang.perl.modules.html-template |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Apr 6, 2011 at 8:28 PM, Lyle <[email protected]> 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 ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev