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