Template::Constants3pm
Defines constants for the template toolkit
Usage
use Template::Constants qw( :status :error :all );
Overview
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::Constants;print Template::Constants::STATUS_DECLINED;
Constants may be imported into the caller's namespace by naming them as options to the "use Template::Constants" statement:
use Template::Constants qw( STATUS_DECLINED );print STATUS_DECLINED;
Alternatively, one of the following tagset identifiers may be specified to import sets of constants: '":status"', '":error"', '":all"'.
use Template::Constants qw( :status );print STATUS_DECLINED;
Consult the documentation for the "Exporter" module for more information on exporting variables.
Exportable tag sets
The following tag sets and associated constants are defined:
:statusSTATUS_OK # no problem, continueSTATUS_RETURN # ended current block then continue (ok)STATUS_STOP # controlled stop (ok)STATUS_DONE # iterator is all done (ok)STATUS_DECLINED # provider declined to service request (ok)STATUS_ERROR # general error condition (not ok):errorERROR_RETURN # return a status code (e.g. 'stop')ERROR_FILE # file error: I/O, parse, recursionERROR_UNDEF # undefined variable value usedERROR_PERL # error in [% PERL %] blockERROR_FILTER # filter errorERROR_PLUGIN # plugin error:chomp # for PRE_CHOMP and POST_CHOMPCHOMP_NONE # do not remove whitespaceCHOMP_ONE # remove whitespace to newlineCHOMP_ALL # old name for CHOMP_ONE (deprecated)CHOMP_COLLAPSE # collapse whitespace to a single spaceCHOMP_GREEDY # remove all whitespace including newlines:debugDEBUG_OFF # do nothingDEBUG_ON # basic debugging flagDEBUG_UNDEF # throw undef on undefined variablesDEBUG_VARS # general variable debuggingDEBUG_DIRS # directive debuggingDEBUG_STASH # general stash debuggingDEBUG_CONTEXT # context debuggingDEBUG_PARSER # parser debuggingDEBUG_PROVIDER # provider debuggingDEBUG_PLUGINS # plugins debuggingDEBUG_FILTERS # filters debuggingDEBUG_SERVICE # context debuggingDEBUG_ALL # everythingDEBUG_CALLER # add caller file/line infoDEBUG_FLAGS # bitmap used internally:allAll the above constants.
Releases
13 releases since Debian 3.0 (Woody); the text changed 11 times.