NAME
Template::Constants - Defines constants for the Template Toolkit
SYNOPSIS
use Template::Constants qw( :template :status :error :ops
:cache :debug :all );
DESCRIPTION
The Template::Constants modules defines, and optionally exports into the caller's namespace, a number of constants used by the Template package.
Constants may be used by specifying the Template::Constants package explicitly:
use Template;
use Template::Constants;
my $template = Template->new({
DEBUG => Template::Constants::DEBUG_ALL
});
Constants may be imported into the caller's namespace by naming them as options to the use Template::Constants
statement:
use Template::Constants qw( DEBUG_ALL );
Alternatively, one of the following tagset identifiers may be specified (prefixed by ':') to import sets of constants; reset, notify, expand, debug.
use Template;
use Template::Constants qw( :debug );
my $template = Template->new({
DEBUG => DEBUG_ALL
});
The Template module uses the Template::Constants module and delegates any import specifications to it. Thus, it is sufficient to use Template
without requiring a further use Template::Constants
.
use Template qw( :error :debug );
my $template = Template->new({
DEBUG => DEBUG_ALL
});
See Exporter for more information on exporting variables.
EXPORTABLE TAG SETS
The following tag sets and associated constants are defined:
:template General purpose Template control parameters.
TEMPLATE_OUTPUT # indicates output "stream"
TEMPLATE_ERROR # indicates error "stream"
:status Status codes, returned by toolkit and user code
STATUS_OK # no problem, continue
STATUS_RETURN # ended current block then continue (ok)
STATUS_STOP # controlled stop (ok)
STATUS_DONE # iterator is all done (ok)
STATUS_ERROR # general error condition (not ok)
:error Error (exception) types thrown by toolkit
ERROR_FILE # file missing or parse error
ERROR_UNDEF # undefined variables
:ops Fundamental 'opcodes' of context runtime.
(see Context::_runop() for details)
:all All the above constants.
AUTHOR
Andy Wardley <abw@cre.canon.co.uk>
REVISION
$Revision: 1.11 $
COPYRIGHT
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.