1Template::Constants(3)User Contributed Perl DocumentationTemplate::Constants(3)
2
3
4
6 Template::Constants - Defines constants for the Template Toolkit
7
9 use Template::Constants qw( :status :error :all );
10
12 The "Template::Constants" modules defines, and optionally exports into
13 the caller's namespace, a number of constants used by the Template
14 package.
15
16 Constants may be used by specifying the "Template::Constants" package
17 explicitly:
18
19 use Template::Constants;
20 print Template::Constants::STATUS_DECLINED;
21
22 Constants may be imported into the caller's namespace by naming them as
23 options to the "use Template::Constants" statement:
24
25 use Template::Constants qw( STATUS_DECLINED );
26 print STATUS_DECLINED;
27
28 Alternatively, one of the following tagset identifiers may be specified
29 to import sets of constants: '":status"', '":error"', '":all"'.
30
31 use Template::Constants qw( :status );
32 print STATUS_DECLINED;
33
34 Consult the documentation for the "Exporter" module for more
35 information on exporting variables.
36
38 The following tag sets and associated constants are defined:
39
40 :status
41 STATUS_OK # no problem, continue
42 STATUS_RETURN # ended current block then continue (ok)
43 STATUS_STOP # controlled stop (ok)
44 STATUS_DONE # iterator is all done (ok)
45 STATUS_DECLINED # provider declined to service request (ok)
46 STATUS_ERROR # general error condition (not ok)
47
48 :error
49 ERROR_RETURN # return a status code (e.g. 'stop')
50 ERROR_FILE # file error: I/O, parse, recursion
51 ERROR_UNDEF # undefined variable value used
52 ERROR_PERL # error in [% PERL %] block
53 ERROR_FILTER # filter error
54 ERROR_PLUGIN # plugin error
55
56 :chomp # for PRE_CHOMP and POST_CHOMP
57 CHOMP_NONE # do not remove whitespace
58 CHOMP_ONE # remove whitespace to newline
59 CHOMP_ALL # old name for CHOMP_ONE (deprecated)
60 CHOMP_COLLAPSE # collapse whitespace to a single space
61 CHOMP_GREEDY # remove all whitespace including newlines
62
63 :debug
64 DEBUG_OFF # do nothing
65 DEBUG_ON # basic debugging flag
66 DEBUG_UNDEF # throw undef on undefined variables
67 DEBUG_VARS # general variable debugging
68 DEBUG_DIRS # directive debugging
69 DEBUG_STASH # general stash debugging
70 DEBUG_CONTEXT # context debugging
71 DEBUG_PARSER # parser debugging
72 DEBUG_PROVIDER # provider debugging
73 DEBUG_PLUGINS # plugins debugging
74 DEBUG_FILTERS # filters debugging
75 DEBUG_SERVICE # context debugging
76 DEBUG_ALL # everything
77 DEBUG_CALLER # add caller file/line info
78 DEBUG_FLAGS # bitmap used internally
79
80 :all
81 All the above constants.
82
84 Andy Wardley <abw@wardley.org> <http://wardley.org/>
85
87 Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
88
89 This module is free software; you can redistribute it and/or modify it
90 under the same terms as Perl itself.
91
93 Template, "Exporter"
94
95
96
97perl v5.34.0 2022-01-21 Template::Constants(3)