← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 13:50:58 2016
Reported on Fri Jan 8 13:51:26 2016

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Constants.pm
StatementsExecuted 87 statements in 2.84ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs56µsTemplate::Constants::::BEGIN@27Template::Constants::BEGIN@27
11116µs41µsTemplate::Constants::::BEGIN@48Template::Constants::BEGIN@48
11115µs22µsTemplate::Constants::::BEGIN@22Template::Constants::BEGIN@22
11113µs56µsTemplate::Constants::::BEGIN@40Template::Constants::BEGIN@40
11110µs32µsTemplate::Constants::::BEGIN@69Template::Constants::BEGIN@69
1119µs24µsTemplate::Constants::::BEGIN@60Template::Constants::BEGIN@60
1119µs26µsTemplate::Constants::::BEGIN@64Template::Constants::BEGIN@64
1119µs24µsTemplate::Constants::::BEGIN@42Template::Constants::BEGIN@42
1118µs24µsTemplate::Constants::::BEGIN@24Template::Constants::BEGIN@24
1118µs25µsTemplate::Constants::::BEGIN@51Template::Constants::BEGIN@51
1118µs23µsTemplate::Constants::::BEGIN@80Template::Constants::BEGIN@80
1118µs25µsTemplate::Constants::::BEGIN@50Template::Constants::BEGIN@50
1118µs24µsTemplate::Constants::::BEGIN@59Template::Constants::BEGIN@59
1118µs25µsTemplate::Constants::::BEGIN@52Template::Constants::BEGIN@52
1118µs81µsTemplate::Constants::::BEGIN@71Template::Constants::BEGIN@71
1118µs20µsTemplate::Constants::::BEGIN@79Template::Constants::BEGIN@79
1118µs21µsTemplate::Constants::::BEGIN@44Template::Constants::BEGIN@44
1118µs25µsTemplate::Constants::::BEGIN@68Template::Constants::BEGIN@68
1118µs26µsTemplate::Constants::::BEGIN@45Template::Constants::BEGIN@45
1118µs32µsTemplate::Constants::::BEGIN@49Template::Constants::BEGIN@49
1118µs21µsTemplate::Constants::::BEGIN@61Template::Constants::BEGIN@61
1118µs22µsTemplate::Constants::::BEGIN@70Template::Constants::BEGIN@70
1118µs21µsTemplate::Constants::::BEGIN@57Template::Constants::BEGIN@57
1118µs24µsTemplate::Constants::::BEGIN@67Template::Constants::BEGIN@67
1118µs22µsTemplate::Constants::::BEGIN@72Template::Constants::BEGIN@72
1117µs27µsTemplate::Constants::::BEGIN@41Template::Constants::BEGIN@41
1117µs22µsTemplate::Constants::::BEGIN@53Template::Constants::BEGIN@53
1117µs28µsTemplate::Constants::::BEGIN@65Template::Constants::BEGIN@65
1117µs11µsTemplate::Constants::::BEGIN@23Template::Constants::BEGIN@23
1117µs47µsTemplate::Constants::::BEGIN@28Template::Constants::BEGIN@28
1117µs21µsTemplate::Constants::::BEGIN@58Template::Constants::BEGIN@58
1117µs20µsTemplate::Constants::::BEGIN@73Template::Constants::BEGIN@73
1117µs22µsTemplate::Constants::::BEGIN@43Template::Constants::BEGIN@43
1117µs21µsTemplate::Constants::::BEGIN@54Template::Constants::BEGIN@54
1117µs21µsTemplate::Constants::::BEGIN@66Template::Constants::BEGIN@66
1117µs19µsTemplate::Constants::::BEGIN@76Template::Constants::BEGIN@76
1116µs18µsTemplate::Constants::::BEGIN@74Template::Constants::BEGIN@74
1116µs18µsTemplate::Constants::::BEGIN@75Template::Constants::BEGIN@75
2113µs3µsTemplate::Constants::::DEBUG_OFFTemplate::Constants::DEBUG_OFF (xsub)
211800ns800nsTemplate::Constants::::DEBUG_ONTemplate::Constants::DEBUG_ON (xsub)
211800ns800nsTemplate::Constants::::DEBUG_PARSERTemplate::Constants::DEBUG_PARSER (xsub)
211800ns800nsTemplate::Constants::::DEBUG_UNDEFTemplate::Constants::DEBUG_UNDEF (xsub)
211700ns700nsTemplate::Constants::::DEBUG_CONTEXTTemplate::Constants::DEBUG_CONTEXT (xsub)
211600ns600nsTemplate::Constants::::DEBUG_PROVIDERTemplate::Constants::DEBUG_PROVIDER (xsub)
211600ns600nsTemplate::Constants::::DEBUG_VARSTemplate::Constants::DEBUG_VARS (xsub)
211500ns500nsTemplate::Constants::::DEBUG_ALLTemplate::Constants::DEBUG_ALL (xsub)
211500ns500nsTemplate::Constants::::DEBUG_CALLERTemplate::Constants::DEBUG_CALLER (xsub)
211500ns500nsTemplate::Constants::::DEBUG_DIRSTemplate::Constants::DEBUG_DIRS (xsub)
211500ns500nsTemplate::Constants::::DEBUG_FILTERSTemplate::Constants::DEBUG_FILTERS (xsub)
211500ns500nsTemplate::Constants::::DEBUG_STASHTemplate::Constants::DEBUG_STASH (xsub)
211400ns400nsTemplate::Constants::::DEBUG_PLUGINSTemplate::Constants::DEBUG_PLUGINS (xsub)
211400ns400nsTemplate::Constants::::DEBUG_SERVICETemplate::Constants::DEBUG_SERVICE (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
2112µsrequire Exporter;
22236µs228µs
# spent 22µs (15+7) within Template::Constants::BEGIN@22 which was called: # once (15µs+7µs) by Template::Base::BEGIN@24 at line 22
use strict;
# spent 22µs making 1 call to Template::Constants::BEGIN@22 # spent 6µs making 1 call to strict::import
23227µs215µs
# spent 11µs (7+4) within Template::Constants::BEGIN@23 which was called: # once (7µs+4µs) by Template::Base::BEGIN@24 at line 23
use warnings;
# spent 11µs making 1 call to Template::Constants::BEGIN@23 # spent 4µs making 1 call to warnings::import
24248µs240µs
# spent 24µs (8+16) within Template::Constants::BEGIN@24 which was called: # once (8µs+16µs) by Template::Base::BEGIN@24 at line 24
use Exporter;
# spent 24µs making 1 call to Template::Constants::BEGIN@24 # spent 16µs making 1 call to Exporter::import
25# Perl::MinimumVersion seems to think this is a Perl 5.008ism...
26# use base qw( Exporter );
27284µs294µs
# spent 56µs (18+38) within Template::Constants::BEGIN@27 which was called: # once (18µs+38µs) by Template::Base::BEGIN@24 at line 27
use vars qw( @EXPORT_OK %EXPORT_TAGS );
# spent 56µs making 1 call to Template::Constants::BEGIN@27 # spent 38µs making 1 call to vars::import
282110µs287µs
# spent 47µs (7+40) within Template::Constants::BEGIN@28 which was called: # once (7µs+40µs) by Template::Base::BEGIN@24 at line 28
use vars qw( $DEBUG_OPTIONS @STATUS @ERROR @CHOMP @DEBUG @ISA );
# spent 47µs making 1 call to Template::Constants::BEGIN@28 # spent 40µs making 1 call to vars::import
29# ... so we'll do it the Old Skool way just to keep it quiet
30195µs@ISA = qw( Exporter );
31
321800nsour $VERSION = 2.75;
33
34
35#========================================================================
36# ----- EXPORTER -----
37#========================================================================
38
39# STATUS constants returned by directives
40279µs298µs
# spent 56µs (13+43) within Template::Constants::BEGIN@40 which was called: # once (13µs+43µs) by Template::Base::BEGIN@24 at line 40
use constant STATUS_OK => 0; # ok
# spent 56µs making 1 call to Template::Constants::BEGIN@40 # spent 43µs making 1 call to constant::import
41250µs246µs
# spent 27µs (7+19) within Template::Constants::BEGIN@41 which was called: # once (7µs+19µs) by Template::Base::BEGIN@24 at line 41
use constant STATUS_RETURN => 1; # ok, block ended by RETURN
# spent 27µs making 1 call to Template::Constants::BEGIN@41 # spent 19µs making 1 call to constant::import
42243µs238µs
# spent 24µs (9+15) within Template::Constants::BEGIN@42 which was called: # once (9µs+15µs) by Template::Base::BEGIN@24 at line 42
use constant STATUS_STOP => 2; # ok, stoppped by STOP
# spent 24µs making 1 call to Template::Constants::BEGIN@42 # spent 14µs making 1 call to constant::import
43246µs237µs
# spent 22µs (7+15) within Template::Constants::BEGIN@43 which was called: # once (7µs+15µs) by Template::Base::BEGIN@24 at line 43
use constant STATUS_DONE => 3; # ok, iterator done
# spent 22µs making 1 call to Template::Constants::BEGIN@43 # spent 15µs making 1 call to constant::import
44241µs234µs
# spent 21µs (8+13) within Template::Constants::BEGIN@44 which was called: # once (8µs+13µs) by Template::Base::BEGIN@24 at line 44
use constant STATUS_DECLINED => 4; # ok, declined to service request
# spent 21µs making 1 call to Template::Constants::BEGIN@44 # spent 13µs making 1 call to constant::import
45264µs245µs
# spent 26µs (8+19) within Template::Constants::BEGIN@45 which was called: # once (8µs+19µs) by Template::Base::BEGIN@24 at line 45
use constant STATUS_ERROR => 255; # error condition
# spent 26µs making 1 call to Template::Constants::BEGIN@45 # spent 19µs making 1 call to constant::import
46
47# ERROR constants for indicating exception types
48267µs266µs
# spent 41µs (16+25) within Template::Constants::BEGIN@48 which was called: # once (16µs+25µs) by Template::Base::BEGIN@24 at line 48
use constant ERROR_RETURN => 'return'; # return a status code
# spent 41µs making 1 call to Template::Constants::BEGIN@48 # spent 25µs making 1 call to constant::import
49258µs255µs
# spent 32µs (8+24) within Template::Constants::BEGIN@49 which was called: # once (8µs+24µs) by Template::Base::BEGIN@24 at line 49
use constant ERROR_FILE => 'file'; # file error: I/O, parse, recursion
# spent 32µs making 1 call to Template::Constants::BEGIN@49 # spent 24µs making 1 call to constant::import
50261µs242µs
# spent 25µs (8+17) within Template::Constants::BEGIN@50 which was called: # once (8µs+17µs) by Template::Base::BEGIN@24 at line 50
use constant ERROR_VIEW => 'view'; # view error
# spent 25µs making 1 call to Template::Constants::BEGIN@50 # spent 17µs making 1 call to constant::import
51248µs242µs
# spent 25µs (8+17) within Template::Constants::BEGIN@51 which was called: # once (8µs+17µs) by Template::Base::BEGIN@24 at line 51
use constant ERROR_UNDEF => 'undef'; # undefined variable value used
# spent 25µs making 1 call to Template::Constants::BEGIN@51 # spent 17µs making 1 call to constant::import
52248µs242µs
# spent 25µs (8+17) within Template::Constants::BEGIN@52 which was called: # once (8µs+17µs) by Template::Base::BEGIN@24 at line 52
use constant ERROR_PERL => 'perl'; # error in [% PERL %] block
# spent 25µs making 1 call to Template::Constants::BEGIN@52 # spent 17µs making 1 call to constant::import
53243µs236µs
# spent 22µs (7+14) within Template::Constants::BEGIN@53 which was called: # once (7µs+14µs) by Template::Base::BEGIN@24 at line 53
use constant ERROR_FILTER => 'filter'; # filter error
# spent 22µs making 1 call to Template::Constants::BEGIN@53 # spent 14µs making 1 call to constant::import
54251µs235µs
# spent 21µs (7+14) within Template::Constants::BEGIN@54 which was called: # once (7µs+14µs) by Template::Base::BEGIN@24 at line 54
use constant ERROR_PLUGIN => 'plugin'; # plugin error
# spent 21µs making 1 call to Template::Constants::BEGIN@54 # spent 14µs making 1 call to constant::import
55
56# CHOMP constants for PRE_CHOMP and POST_CHOMP
57246µs235µs
# spent 21µs (8+14) within Template::Constants::BEGIN@57 which was called: # once (8µs+14µs) by Template::Base::BEGIN@24 at line 57
use constant CHOMP_NONE => 0; # do not remove whitespace
# spent 21µs making 1 call to Template::Constants::BEGIN@57 # spent 14µs making 1 call to constant::import
58243µs235µs
# spent 21µs (7+14) within Template::Constants::BEGIN@58 which was called: # once (7µs+14µs) by Template::Base::BEGIN@24 at line 58
use constant CHOMP_ALL => 1; # remove whitespace up to newline
# spent 21µs making 1 call to Template::Constants::BEGIN@58 # spent 14µs making 1 call to constant::import
59248µs240µs
# spent 24µs (8+16) within Template::Constants::BEGIN@59 which was called: # once (8µs+16µs) by Template::Base::BEGIN@24 at line 59
use constant CHOMP_ONE => 1; # new name for CHOMP_ALL
# spent 24µs making 1 call to Template::Constants::BEGIN@59 # spent 16µs making 1 call to constant::import
60244µs238µs
# spent 24µs (9+15) within Template::Constants::BEGIN@60 which was called: # once (9µs+15µs) by Template::Base::BEGIN@24 at line 60
use constant CHOMP_COLLAPSE => 2; # collapse whitespace to a single space
# spent 24µs making 1 call to Template::Constants::BEGIN@60 # spent 15µs making 1 call to constant::import
61249µs235µs
# spent 21µs (8+14) within Template::Constants::BEGIN@61 which was called: # once (8µs+14µs) by Template::Base::BEGIN@24 at line 61
use constant CHOMP_GREEDY => 3; # remove all whitespace including newlines
# spent 21µs making 1 call to Template::Constants::BEGIN@61 # spent 14µs making 1 call to constant::import
62
63# DEBUG constants to enable various debugging options
64249µs242µs
# spent 26µs (9+16) within Template::Constants::BEGIN@64 which was called: # once (9µs+16µs) by Template::Base::BEGIN@24 at line 64
use constant DEBUG_OFF => 0; # do nothing
# spent 26µs making 1 call to Template::Constants::BEGIN@64 # spent 16µs making 1 call to constant::import
65251µs248µs
# spent 28µs (7+20) within Template::Constants::BEGIN@65 which was called: # once (7µs+20µs) by Template::Base::BEGIN@24 at line 65
use constant DEBUG_ON => 1; # basic debugging flag
# spent 28µs making 1 call to Template::Constants::BEGIN@65 # spent 20µs making 1 call to constant::import
66242µs234µs
# spent 21µs (7+14) within Template::Constants::BEGIN@66 which was called: # once (7µs+14µs) by Template::Base::BEGIN@24 at line 66
use constant DEBUG_UNDEF => 2; # throw undef on undefined variables
# spent 21µs making 1 call to Template::Constants::BEGIN@66 # spent 14µs making 1 call to constant::import
67250µs240µs
# spent 24µs (8+16) within Template::Constants::BEGIN@67 which was called: # once (8µs+16µs) by Template::Base::BEGIN@24 at line 67
use constant DEBUG_VARS => 4; # general variable debugging
# spent 24µs making 1 call to Template::Constants::BEGIN@67 # spent 16µs making 1 call to constant::import
68250µs243µs
# spent 25µs (8+18) within Template::Constants::BEGIN@68 which was called: # once (8µs+18µs) by Template::Base::BEGIN@24 at line 68
use constant DEBUG_DIRS => 8; # directive debugging
# spent 25µs making 1 call to Template::Constants::BEGIN@68 # spent 18µs making 1 call to constant::import
69255µs254µs
# spent 32µs (10+22) within Template::Constants::BEGIN@69 which was called: # once (10µs+22µs) by Template::Base::BEGIN@24 at line 69
use constant DEBUG_STASH => 16; # general stash debugging
# spent 32µs making 1 call to Template::Constants::BEGIN@69 # spent 22µs making 1 call to constant::import
70243µs235µs
# spent 22µs (8+14) within Template::Constants::BEGIN@70 which was called: # once (8µs+14µs) by Template::Base::BEGIN@24 at line 70
use constant DEBUG_CONTEXT => 32; # context debugging
# spent 22µs making 1 call to Template::Constants::BEGIN@70 # spent 14µs making 1 call to constant::import
712106µs2154µs
# spent 81µs (8+73) within Template::Constants::BEGIN@71 which was called: # once (8µs+73µs) by Template::Base::BEGIN@24 at line 71
use constant DEBUG_PARSER => 64; # parser debugging
# spent 81µs making 1 call to Template::Constants::BEGIN@71 # spent 73µs making 1 call to constant::import
72246µs238µs
# spent 22µs (8+15) within Template::Constants::BEGIN@72 which was called: # once (8µs+15µs) by Template::Base::BEGIN@24 at line 72
use constant DEBUG_PROVIDER => 128; # provider debugging
# spent 22µs making 1 call to Template::Constants::BEGIN@72 # spent 15µs making 1 call to constant::import
73239µs232µs
# spent 20µs (7+12) within Template::Constants::BEGIN@73 which was called: # once (7µs+12µs) by Template::Base::BEGIN@24 at line 73
use constant DEBUG_PLUGINS => 256; # plugins debugging
# spent 20µs making 1 call to Template::Constants::BEGIN@73 # spent 12µs making 1 call to constant::import
74237µs230µs
# spent 18µs (6+12) within Template::Constants::BEGIN@74 which was called: # once (6µs+12µs) by Template::Base::BEGIN@24 at line 74
use constant DEBUG_FILTERS => 512; # filters debugging
# spent 18µs making 1 call to Template::Constants::BEGIN@74 # spent 12µs making 1 call to constant::import
75247µs230µs
# spent 18µs (6+12) within Template::Constants::BEGIN@75 which was called: # once (6µs+12µs) by Template::Base::BEGIN@24 at line 75
use constant DEBUG_SERVICE => 1024; # context debugging
# spent 18µs making 1 call to Template::Constants::BEGIN@75 # spent 12µs making 1 call to constant::import
76240µs232µs
# spent 19µs (7+13) within Template::Constants::BEGIN@76 which was called: # once (7µs+13µs) by Template::Base::BEGIN@24 at line 76
use constant DEBUG_ALL => 2047; # everything
# spent 19µs making 1 call to Template::Constants::BEGIN@76 # spent 13µs making 1 call to constant::import
77
78# extra debugging flags
79245µs232µs
# spent 20µs (8+12) within Template::Constants::BEGIN@79 which was called: # once (8µs+12µs) by Template::Base::BEGIN@24 at line 79
use constant DEBUG_CALLER => 4096; # add caller file/line
# spent 20µs making 1 call to Template::Constants::BEGIN@79 # spent 12µs making 1 call to constant::import
802653µs238µs
# spent 23µs (8+15) within Template::Constants::BEGIN@80 which was called: # once (8µs+15µs) by Template::Base::BEGIN@24 at line 80
use constant DEBUG_FLAGS => 4096; # bitmask to extraxt flags
# spent 23µs making 1 call to Template::Constants::BEGIN@80 # spent 15µs making 1 call to constant::import
81
821113µs2811µs$DEBUG_OPTIONS = {
# spent 3µs making 2 calls to Template::Constants::DEBUG_OFF, avg 2µs/call # spent 800ns making 2 calls to Template::Constants::DEBUG_ON, avg 400ns/call # spent 800ns making 2 calls to Template::Constants::DEBUG_PARSER, avg 400ns/call # spent 800ns making 2 calls to Template::Constants::DEBUG_UNDEF, avg 400ns/call # spent 700ns making 2 calls to Template::Constants::DEBUG_CONTEXT, avg 350ns/call # spent 600ns making 2 calls to Template::Constants::DEBUG_PROVIDER, avg 300ns/call # spent 600ns making 2 calls to Template::Constants::DEBUG_VARS, avg 300ns/call # spent 500ns making 2 calls to Template::Constants::DEBUG_ALL, avg 250ns/call # spent 500ns making 2 calls to Template::Constants::DEBUG_CALLER, avg 250ns/call # spent 500ns making 2 calls to Template::Constants::DEBUG_DIRS, avg 250ns/call # spent 500ns making 2 calls to Template::Constants::DEBUG_FILTERS, avg 250ns/call # spent 500ns making 2 calls to Template::Constants::DEBUG_STASH, avg 250ns/call # spent 400ns making 2 calls to Template::Constants::DEBUG_PLUGINS, avg 200ns/call # spent 400ns making 2 calls to Template::Constants::DEBUG_SERVICE, avg 200ns/call
83 &DEBUG_OFF => off => off => &DEBUG_OFF,
84 &DEBUG_ON => on => on => &DEBUG_ON,
85 &DEBUG_UNDEF => undef => undef => &DEBUG_UNDEF,
86 &DEBUG_VARS => vars => vars => &DEBUG_VARS,
87 &DEBUG_DIRS => dirs => dirs => &DEBUG_DIRS,
88 &DEBUG_STASH => stash => stash => &DEBUG_STASH,
89 &DEBUG_CONTEXT => context => context => &DEBUG_CONTEXT,
90 &DEBUG_PARSER => parser => parser => &DEBUG_PARSER,
91 &DEBUG_PROVIDER => provider => provider => &DEBUG_PROVIDER,
92 &DEBUG_PLUGINS => plugins => plugins => &DEBUG_PLUGINS,
93 &DEBUG_FILTERS => filters => filters => &DEBUG_FILTERS,
94 &DEBUG_SERVICE => service => service => &DEBUG_SERVICE,
95 &DEBUG_ALL => all => all => &DEBUG_ALL,
96 &DEBUG_CALLER => caller => caller => &DEBUG_CALLER,
97};
98
9911µs@STATUS = qw( STATUS_OK STATUS_RETURN STATUS_STOP STATUS_DONE
100 STATUS_DECLINED STATUS_ERROR );
1011800ns@ERROR = qw( ERROR_FILE ERROR_VIEW ERROR_UNDEF ERROR_PERL
102 ERROR_RETURN ERROR_FILTER ERROR_PLUGIN );
1031600ns@CHOMP = qw( CHOMP_NONE CHOMP_ALL CHOMP_ONE CHOMP_COLLAPSE CHOMP_GREEDY );
10412µs@DEBUG = qw( DEBUG_OFF DEBUG_ON DEBUG_UNDEF DEBUG_VARS
105 DEBUG_DIRS DEBUG_STASH DEBUG_CONTEXT DEBUG_PARSER
106 DEBUG_PROVIDER DEBUG_PLUGINS DEBUG_FILTERS DEBUG_SERVICE
107 DEBUG_ALL DEBUG_CALLER DEBUG_FLAGS );
108
10912µs@EXPORT_OK = ( @STATUS, @ERROR, @CHOMP, @DEBUG );
110110µs%EXPORT_TAGS = (
111 'all' => [ @EXPORT_OK ],
112 'status' => [ @STATUS ],
113 'error' => [ @ERROR ],
114 'chomp' => [ @CHOMP ],
115 'debug' => [ @DEBUG ],
116);
117
118
119sub debug_flags {
120 my ($self, $debug) = @_;
121 my (@flags, $flag, $value);
122 $debug = $self unless defined($debug) || ref($self);
123
124 if ($debug =~ /^\d+$/) {
125 foreach $flag (@DEBUG) {
126 next if $flag =~ /^DEBUG_(OFF|ALL|FLAGS)$/;
127
128 # don't trash the original
129 my $copy = $flag;
130 $flag =~ s/^DEBUG_//;
131 $flag = lc $flag;
132 return $self->error("no value for flag: $flag")
133 unless defined($value = $DEBUG_OPTIONS->{ $flag });
134 $flag = $value;
135
136 if ($debug & $flag) {
137 $value = $DEBUG_OPTIONS->{ $flag };
138 return $self->error("no value for flag: $flag") unless defined $value;
139 push(@flags, $value);
140 }
141 }
142 return wantarray ? @flags : join(', ', @flags);
143 }
144 else {
145 @flags = split(/\W+/, $debug);
146 $debug = 0;
147 foreach $flag (@flags) {
148 $value = $DEBUG_OPTIONS->{ $flag };
149 return $self->error("unknown debug flag: $flag") unless defined $value;
150 $debug |= $value;
151 }
152 return $debug;
153 }
154}
155
156
157124µs1;
158
159__END__
 
# spent 500ns within Template::Constants::DEBUG_ALL which was called 2 times, avg 250ns/call: # 2 times (500ns+0s) by Template::Base::BEGIN@24 at line 82, avg 250ns/call
sub Template::Constants::DEBUG_ALL; # xsub
# spent 500ns within Template::Constants::DEBUG_CALLER which was called 2 times, avg 250ns/call: # 2 times (500ns+0s) by Template::Base::BEGIN@24 at line 82, avg 250ns/call
sub Template::Constants::DEBUG_CALLER; # xsub
# spent 700ns within Template::Constants::DEBUG_CONTEXT which was called 2 times, avg 350ns/call: # 2 times (700ns+0s) by Template::Base::BEGIN@24 at line 82, avg 350ns/call
sub Template::Constants::DEBUG_CONTEXT; # xsub
# spent 500ns within Template::Constants::DEBUG_DIRS which was called 2 times, avg 250ns/call: # 2 times (500ns+0s) by Template::Base::BEGIN@24 at line 82, avg 250ns/call
sub Template::Constants::DEBUG_DIRS; # xsub
# spent 500ns within Template::Constants::DEBUG_FILTERS which was called 2 times, avg 250ns/call: # 2 times (500ns+0s) by Template::Base::BEGIN@24 at line 82, avg 250ns/call
sub Template::Constants::DEBUG_FILTERS; # xsub
# spent 3µs within Template::Constants::DEBUG_OFF which was called 2 times, avg 2µs/call: # 2 times (3µs+0s) by Template::Base::BEGIN@24 at line 82, avg 2µs/call
sub Template::Constants::DEBUG_OFF; # xsub
# spent 800ns within Template::Constants::DEBUG_ON which was called 2 times, avg 400ns/call: # 2 times (800ns+0s) by Template::Base::BEGIN@24 at line 82, avg 400ns/call
sub Template::Constants::DEBUG_ON; # xsub
# spent 800ns within Template::Constants::DEBUG_PARSER which was called 2 times, avg 400ns/call: # 2 times (800ns+0s) by Template::Base::BEGIN@24 at line 82, avg 400ns/call
sub Template::Constants::DEBUG_PARSER; # xsub
# spent 400ns within Template::Constants::DEBUG_PLUGINS which was called 2 times, avg 200ns/call: # 2 times (400ns+0s) by Template::Base::BEGIN@24 at line 82, avg 200ns/call
sub Template::Constants::DEBUG_PLUGINS; # xsub
# spent 600ns within Template::Constants::DEBUG_PROVIDER which was called 2 times, avg 300ns/call: # 2 times (600ns+0s) by Template::Base::BEGIN@24 at line 82, avg 300ns/call
sub Template::Constants::DEBUG_PROVIDER; # xsub
# spent 400ns within Template::Constants::DEBUG_SERVICE which was called 2 times, avg 200ns/call: # 2 times (400ns+0s) by Template::Base::BEGIN@24 at line 82, avg 200ns/call
sub Template::Constants::DEBUG_SERVICE; # xsub
# spent 500ns within Template::Constants::DEBUG_STASH which was called 2 times, avg 250ns/call: # 2 times (500ns+0s) by Template::Base::BEGIN@24 at line 82, avg 250ns/call
sub Template::Constants::DEBUG_STASH; # xsub
# spent 800ns within Template::Constants::DEBUG_UNDEF which was called 2 times, avg 400ns/call: # 2 times (800ns+0s) by Template::Base::BEGIN@24 at line 82, avg 400ns/call
sub Template::Constants::DEBUG_UNDEF; # xsub
# spent 600ns within Template::Constants::DEBUG_VARS which was called 2 times, avg 300ns/call: # 2 times (600ns+0s) by Template::Base::BEGIN@24 at line 82, avg 300ns/call
sub Template::Constants::DEBUG_VARS; # xsub