← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:10 2021

Filename/usr/local/lib/perl5/site_perl/mach/5.32/Template/Constants.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sTemplate::Constants::::BEGIN@22Template::Constants::BEGIN@22
0000s0sTemplate::Constants::::BEGIN@23Template::Constants::BEGIN@23
0000s0sTemplate::Constants::::BEGIN@24Template::Constants::BEGIN@24
0000s0sTemplate::Constants::::BEGIN@26Template::Constants::BEGIN@26
0000s0sTemplate::Constants::::BEGIN@38Template::Constants::BEGIN@38
0000s0sTemplate::Constants::::BEGIN@39Template::Constants::BEGIN@39
0000s0sTemplate::Constants::::BEGIN@40Template::Constants::BEGIN@40
0000s0sTemplate::Constants::::BEGIN@41Template::Constants::BEGIN@41
0000s0sTemplate::Constants::::BEGIN@42Template::Constants::BEGIN@42
0000s0sTemplate::Constants::::BEGIN@43Template::Constants::BEGIN@43
0000s0sTemplate::Constants::::BEGIN@46Template::Constants::BEGIN@46
0000s0sTemplate::Constants::::BEGIN@47Template::Constants::BEGIN@47
0000s0sTemplate::Constants::::BEGIN@48Template::Constants::BEGIN@48
0000s0sTemplate::Constants::::BEGIN@49Template::Constants::BEGIN@49
0000s0sTemplate::Constants::::BEGIN@50Template::Constants::BEGIN@50
0000s0sTemplate::Constants::::BEGIN@51Template::Constants::BEGIN@51
0000s0sTemplate::Constants::::BEGIN@52Template::Constants::BEGIN@52
0000s0sTemplate::Constants::::BEGIN@55Template::Constants::BEGIN@55
0000s0sTemplate::Constants::::BEGIN@56Template::Constants::BEGIN@56
0000s0sTemplate::Constants::::BEGIN@57Template::Constants::BEGIN@57
0000s0sTemplate::Constants::::BEGIN@58Template::Constants::BEGIN@58
0000s0sTemplate::Constants::::BEGIN@59Template::Constants::BEGIN@59
0000s0sTemplate::Constants::::BEGIN@62Template::Constants::BEGIN@62
0000s0sTemplate::Constants::::BEGIN@63Template::Constants::BEGIN@63
0000s0sTemplate::Constants::::BEGIN@64Template::Constants::BEGIN@64
0000s0sTemplate::Constants::::BEGIN@65Template::Constants::BEGIN@65
0000s0sTemplate::Constants::::BEGIN@66Template::Constants::BEGIN@66
0000s0sTemplate::Constants::::BEGIN@67Template::Constants::BEGIN@67
0000s0sTemplate::Constants::::BEGIN@68Template::Constants::BEGIN@68
0000s0sTemplate::Constants::::BEGIN@69Template::Constants::BEGIN@69
0000s0sTemplate::Constants::::BEGIN@70Template::Constants::BEGIN@70
0000s0sTemplate::Constants::::BEGIN@71Template::Constants::BEGIN@71
0000s0sTemplate::Constants::::BEGIN@72Template::Constants::BEGIN@72
0000s0sTemplate::Constants::::BEGIN@73Template::Constants::BEGIN@73
0000s0sTemplate::Constants::::BEGIN@74Template::Constants::BEGIN@74
0000s0sTemplate::Constants::::BEGIN@77Template::Constants::BEGIN@77
0000s0sTemplate::Constants::::BEGIN@78Template::Constants::BEGIN@78
0000s0sTemplate::Constants::::DEBUG_ALLTemplate::Constants::DEBUG_ALL (xsub)
0000s0sTemplate::Constants::::DEBUG_CALLERTemplate::Constants::DEBUG_CALLER (xsub)
0000s0sTemplate::Constants::::DEBUG_CONTEXTTemplate::Constants::DEBUG_CONTEXT (xsub)
0000s0sTemplate::Constants::::DEBUG_DIRSTemplate::Constants::DEBUG_DIRS (xsub)
0000s0sTemplate::Constants::::DEBUG_FILTERSTemplate::Constants::DEBUG_FILTERS (xsub)
0000s0sTemplate::Constants::::DEBUG_OFFTemplate::Constants::DEBUG_OFF (xsub)
0000s0sTemplate::Constants::::DEBUG_ONTemplate::Constants::DEBUG_ON (xsub)
0000s0sTemplate::Constants::::DEBUG_PARSERTemplate::Constants::DEBUG_PARSER (xsub)
0000s0sTemplate::Constants::::DEBUG_PLUGINSTemplate::Constants::DEBUG_PLUGINS (xsub)
0000s0sTemplate::Constants::::DEBUG_PROVIDERTemplate::Constants::DEBUG_PROVIDER (xsub)
0000s0sTemplate::Constants::::DEBUG_SERVICETemplate::Constants::DEBUG_SERVICE (xsub)
0000s0sTemplate::Constants::::DEBUG_STASHTemplate::Constants::DEBUG_STASH (xsub)
0000s0sTemplate::Constants::::DEBUG_UNDEFTemplate::Constants::DEBUG_UNDEF (xsub)
0000s0sTemplate::Constants::::DEBUG_VARSTemplate::Constants::DEBUG_VARS (xsub)
0000s0sTemplate::Constants::::debug_flagsTemplate::Constants::debug_flags
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#============================================================= -*-Perl-*-
2#
3# Template::Constants.pm
4#
5# DESCRIPTION
6# Definition of constants for the Template Toolkit.
7#
8# AUTHOR
9# Andy Wardley <abw@wardley.org>
10#
11# COPYRIGHT
12# Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
13#
14# This module is free software; you can redistribute it and/or
15# modify it under the same terms as Perl itself.
16#
17#============================================================================
18
19package Template::Constants;
20
21require Exporter;
22use strict;
23use warnings;
24use Exporter;
25
26use base qw( Exporter );
27
28our ( @EXPORT_OK, %EXPORT_TAGS );
29our ( $DEBUG_OPTIONS, @STATUS, @ERROR, @CHOMP, @DEBUG, @ISA );
30
31our $VERSION = '3.009';
32
33#========================================================================
34# ----- EXPORTER -----
35#========================================================================
36
37# STATUS constants returned by directives
38use constant STATUS_OK => 0; # ok
39use constant STATUS_RETURN => 1; # ok, block ended by RETURN
40use constant STATUS_STOP => 2; # ok, stopped by STOP
41use constant STATUS_DONE => 3; # ok, iterator done
42use constant STATUS_DECLINED => 4; # ok, declined to service request
43use constant STATUS_ERROR => 255; # error condition
44
45# ERROR constants for indicating exception types
46use constant ERROR_RETURN => 'return'; # return a status code
47use constant ERROR_FILE => 'file'; # file error: I/O, parse, recursion
48use constant ERROR_VIEW => 'view'; # view error
49use constant ERROR_UNDEF => 'undef'; # undefined variable value used
50use constant ERROR_PERL => 'perl'; # error in [% PERL %] block
51use constant ERROR_FILTER => 'filter'; # filter error
52use constant ERROR_PLUGIN => 'plugin'; # plugin error
53
54# CHOMP constants for PRE_CHOMP and POST_CHOMP
55use constant CHOMP_NONE => 0; # do not remove whitespace
56use constant CHOMP_ALL => 1; # remove whitespace up to newline
57use constant CHOMP_ONE => 1; # new name for CHOMP_ALL
58use constant CHOMP_COLLAPSE => 2; # collapse whitespace to a single space
59use constant CHOMP_GREEDY => 3; # remove all whitespace including newlines
60
61# DEBUG constants to enable various debugging options
62use constant DEBUG_OFF => 0; # do nothing
63use constant DEBUG_ON => 1; # basic debugging flag
64use constant DEBUG_UNDEF => 2; # throw undef on undefined variables
65use constant DEBUG_VARS => 4; # general variable debugging
66use constant DEBUG_DIRS => 8; # directive debugging
67use constant DEBUG_STASH => 16; # general stash debugging
68use constant DEBUG_CONTEXT => 32; # context debugging
69use constant DEBUG_PARSER => 64; # parser debugging
70use constant DEBUG_PROVIDER => 128; # provider debugging
71use constant DEBUG_PLUGINS => 256; # plugins debugging
72use constant DEBUG_FILTERS => 512; # filters debugging
73use constant DEBUG_SERVICE => 1024; # context debugging
74use constant DEBUG_ALL => 2047; # everything
75
76# extra debugging flags
77use constant DEBUG_CALLER => 4096; # add caller file/line
78use constant DEBUG_FLAGS => 4096; # bitmask to extract flags
79
80$DEBUG_OPTIONS = {
81 &DEBUG_OFF => off => off => &DEBUG_OFF,
82 &DEBUG_ON => on => on => &DEBUG_ON,
83 &DEBUG_UNDEF => undef => undef => &DEBUG_UNDEF,
84 &DEBUG_VARS => vars => vars => &DEBUG_VARS,
85 &DEBUG_DIRS => dirs => dirs => &DEBUG_DIRS,
86 &DEBUG_STASH => stash => stash => &DEBUG_STASH,
87 &DEBUG_CONTEXT => context => context => &DEBUG_CONTEXT,
88 &DEBUG_PARSER => parser => parser => &DEBUG_PARSER,
89 &DEBUG_PROVIDER => provider => provider => &DEBUG_PROVIDER,
90 &DEBUG_PLUGINS => plugins => plugins => &DEBUG_PLUGINS,
91 &DEBUG_FILTERS => filters => filters => &DEBUG_FILTERS,
92 &DEBUG_SERVICE => service => service => &DEBUG_SERVICE,
93 &DEBUG_ALL => all => all => &DEBUG_ALL,
94 &DEBUG_CALLER => caller => caller => &DEBUG_CALLER,
95};
96
97@STATUS = qw( STATUS_OK STATUS_RETURN STATUS_STOP STATUS_DONE
98 STATUS_DECLINED STATUS_ERROR );
99@ERROR = qw( ERROR_FILE ERROR_VIEW ERROR_UNDEF ERROR_PERL
100 ERROR_RETURN ERROR_FILTER ERROR_PLUGIN );
101@CHOMP = qw( CHOMP_NONE CHOMP_ALL CHOMP_ONE CHOMP_COLLAPSE CHOMP_GREEDY );
102@DEBUG = qw( DEBUG_OFF DEBUG_ON DEBUG_UNDEF DEBUG_VARS
103 DEBUG_DIRS DEBUG_STASH DEBUG_CONTEXT DEBUG_PARSER
104 DEBUG_PROVIDER DEBUG_PLUGINS DEBUG_FILTERS DEBUG_SERVICE
105 DEBUG_ALL DEBUG_CALLER DEBUG_FLAGS );
106
107@EXPORT_OK = ( @STATUS, @ERROR, @CHOMP, @DEBUG );
108%EXPORT_TAGS = (
109 'all' => [ @EXPORT_OK ],
110 'status' => [ @STATUS ],
111 'error' => [ @ERROR ],
112 'chomp' => [ @CHOMP ],
113 'debug' => [ @DEBUG ],
114);
115
116
117sub debug_flags {
118 my ($self, $debug) = @_;
119 my (@flags, $flag, $value);
120 $debug = $self unless defined($debug) || ref($self);
121
122 if ( $debug !~ tr{0-9}{}c) {
123 foreach $flag (@DEBUG) {
124 next if $flag eq 'DEBUG_OFF' || $flag eq 'DEBUG_ALL' || $flag eq 'DEBUG_FLAGS';
125
126 # don't trash the original
127 substr($flag,0,6,'') if index($flag,'DEBUG_') == 0;
128 $flag = lc $flag;
129 return $self->error("no value for flag: $flag")
130 unless defined($value = $DEBUG_OPTIONS->{ $flag });
131 $flag = $value;
132
133 if ($debug & $flag) {
134 $value = $DEBUG_OPTIONS->{ $flag };
135 return $self->error("no value for flag: $flag") unless defined $value;
136 push(@flags, $value);
137 }
138 }
139 return wantarray ? @flags : join(', ', @flags);
140 }
141 else {
142 @flags = split(/\W+/, $debug);
143 $debug = 0;
144 foreach $flag (@flags) {
145 $value = $DEBUG_OPTIONS->{ $flag };
146 return $self->error("unknown debug flag: $flag") unless defined $value;
147 $debug |= $value;
148 }
149 return $debug;
150 }
151}
152
153
1541;
155
156__END__