Template::Directive - Object class for defining directives that represent the opcodes of the Template processor.
use Template::Directive; my $dir = Template::Directive->new(\@opcodes); my $inc = Template::Directive::Include->new(\@ident, \@params); my $if = Template::Directive::If->new(\@expr, $true_block, $else_block); my $for = Template::Directive::For->new(\@list, $block, $varname); my $blk = Template::Directive::Block->new($content); my $txt = Template::Directive::Text->new($text); my $thr = Template::Directive::Throw->new($errtype, \@expr); my $cth = Template::Directive::Catch->new($errtype, $block); my $ret = Template::Directive::Return->new($retval); my $dbg = Template::Directive::Debug->new($text);
The Template::Directive module defines a class which represents the basic operations of the Template Processor. These are created and returned (in tree form) by the Template::Parser object as a product of parsing a template file. The process() method is called on the directives at the time at which the "compiled" template is rendered for output.
The derived classes of Template::Directive, as listed above, define specific operations of the template processor. You don't really need to worry about them unless you plan to hack on the internals of the processor.
Andy Wardley <abw@cre.canon.co.uk>
$Revision: 1.19 $
Copyright (C) 1996-1999 Andy Wardley. All Rights Reserved. Copyright (C) 1998-1999 Canon Research Centre Europe Ltd.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Template, Template::Stash, Template::Parser, Template::Grammar
To install Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template
CPAN shell
perl -MCPAN -e shell install Template
For more information on module installation, please visit the detailed CPAN module installation guide.