| Filename | /usr/lib/perl5/Template/Constants.pm |
| Statements | Executed 125 statements in 1.98ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 21µs | 52µs | Template::Constants::BEGIN@61 |
| 1 | 1 | 1 | 20µs | 53µs | Template::Constants::BEGIN@70 |
| 1 | 1 | 1 | 16µs | 20µs | Template::Constants::BEGIN@22 |
| 1 | 1 | 1 | 14µs | 45µs | Template::Constants::BEGIN@53 |
| 1 | 1 | 1 | 14µs | 44µs | Template::Constants::BEGIN@68 |
| 1 | 1 | 1 | 13µs | 69µs | Template::Constants::BEGIN@27 |
| 1 | 1 | 1 | 13µs | 35µs | Template::Constants::BEGIN@24 |
| 1 | 1 | 1 | 11µs | 75µs | Template::Constants::BEGIN@40 |
| 1 | 1 | 1 | 11µs | 22µs | Template::Constants::BEGIN@23 |
| 1 | 1 | 1 | 11µs | 98µs | Template::Constants::BEGIN@28 |
| 1 | 1 | 1 | 10µs | 41µs | Template::Constants::BEGIN@48 |
| 1 | 1 | 1 | 10µs | 41µs | Template::Constants::BEGIN@57 |
| 1 | 1 | 1 | 10µs | 42µs | Template::Constants::BEGIN@76 |
| 1 | 1 | 1 | 9µs | 40µs | Template::Constants::BEGIN@69 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@50 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@54 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@59 |
| 1 | 1 | 1 | 9µs | 40µs | Template::Constants::BEGIN@71 |
| 1 | 1 | 1 | 9µs | 41µs | Template::Constants::BEGIN@42 |
| 1 | 1 | 1 | 9µs | 47µs | Template::Constants::BEGIN@45 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@80 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@49 |
| 1 | 1 | 1 | 9µs | 38µs | Template::Constants::BEGIN@73 |
| 1 | 1 | 1 | 9µs | 50µs | Template::Constants::BEGIN@75 |
| 1 | 1 | 1 | 9µs | 40µs | Template::Constants::BEGIN@65 |
| 1 | 1 | 1 | 9µs | 39µs | Template::Constants::BEGIN@58 |
| 1 | 1 | 1 | 8µs | 40µs | Template::Constants::BEGIN@41 |
| 1 | 1 | 1 | 8µs | 38µs | Template::Constants::BEGIN@60 |
| 1 | 1 | 1 | 8µs | 39µs | Template::Constants::BEGIN@51 |
| 1 | 1 | 1 | 8µs | 39µs | Template::Constants::BEGIN@72 |
| 1 | 1 | 1 | 8µs | 41µs | Template::Constants::BEGIN@64 |
| 1 | 1 | 1 | 8µs | 40µs | Template::Constants::BEGIN@79 |
| 1 | 1 | 1 | 8µs | 38µs | Template::Constants::BEGIN@44 |
| 1 | 1 | 1 | 8µs | 38µs | Template::Constants::BEGIN@52 |
| 1 | 1 | 1 | 8µs | 40µs | Template::Constants::BEGIN@67 |
| 1 | 1 | 1 | 8µs | 39µs | Template::Constants::BEGIN@43 |
| 1 | 1 | 1 | 8µs | 38µs | Template::Constants::BEGIN@66 |
| 1 | 1 | 1 | 8µs | 38µs | Template::Constants::BEGIN@74 |
| 3 | 2 | 2 | 7µs | 7µs | Template::Constants::DEBUG_UNDEF (xsub) |
| 2 | 1 | 1 | 4µs | 4µs | Template::Constants::DEBUG_OFF (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_DIRS (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_FILTERS (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_ON (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_PARSER (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_PROVIDER (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_ALL (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_CONTEXT (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_PLUGINS (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_STASH (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_VARS (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_CALLER (xsub) |
| 2 | 1 | 1 | 1µs | 1µs | Template::Constants::DEBUG_SERVICE (xsub) |
| 0 | 0 | 0 | 0s | 0s | Template::Constants::debug_flags |
| 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 | |||||
| 19 | package Template::Constants; | ||||
| 20 | |||||
| 21 | 1 | 2µs | require Exporter; | ||
| 22 | 3 | 28µs | 2 | 24µs | # spent 20µs (16+4) within Template::Constants::BEGIN@22 which was called:
# once (16µs+4µs) by Template::Base::BEGIN@24 at line 22 # spent 20µs making 1 call to Template::Constants::BEGIN@22
# spent 4µs making 1 call to strict::import |
| 23 | 3 | 25µs | 2 | 33µs | # spent 22µs (11+11) within Template::Constants::BEGIN@23 which was called:
# once (11µs+11µs) by Template::Base::BEGIN@24 at line 23 # spent 22µs making 1 call to Template::Constants::BEGIN@23
# spent 11µs making 1 call to warnings::import |
| 24 | 3 | 33µs | 2 | 57µs | # spent 35µs (13+22) within Template::Constants::BEGIN@24 which was called:
# once (13µs+22µs) by Template::Base::BEGIN@24 at line 24 # spent 35µs making 1 call to Template::Constants::BEGIN@24
# spent 22µs making 1 call to Exporter::import |
| 25 | # Perl::MinimumVersion seems to think this is a Perl 5.008ism... | ||||
| 26 | # use base qw( Exporter ); | ||||
| 27 | 3 | 41µs | 2 | 124µs | # spent 69µs (13+56) within Template::Constants::BEGIN@27 which was called:
# once (13µs+56µs) by Template::Base::BEGIN@24 at line 27 # spent 69µs making 1 call to Template::Constants::BEGIN@27
# spent 56µs making 1 call to vars::import |
| 28 | 3 | 57µs | 2 | 186µs | # spent 98µs (11+88) within Template::Constants::BEGIN@28 which was called:
# once (11µs+88µs) by Template::Base::BEGIN@24 at line 28 # spent 98µs making 1 call to Template::Constants::BEGIN@28
# spent 88µs making 1 call to vars::import |
| 29 | # ... so we'll do it the Old Skool way just to keep it quiet | ||||
| 30 | 1 | 21µs | @ISA = qw( Exporter ); | ||
| 31 | |||||
| 32 | 1 | 600ns | our $VERSION = 2.75; | ||
| 33 | |||||
| 34 | |||||
| 35 | #======================================================================== | ||||
| 36 | # ----- EXPORTER ----- | ||||
| 37 | #======================================================================== | ||||
| 38 | |||||
| 39 | # STATUS constants returned by directives | ||||
| 40 | 3 | 34µs | 2 | 140µs | # spent 75µs (11+64) within Template::Constants::BEGIN@40 which was called:
# once (11µs+64µs) by Template::Base::BEGIN@24 at line 40 # spent 75µs making 1 call to Template::Constants::BEGIN@40
# spent 64µs making 1 call to constant::import |
| 41 | 3 | 36µs | 2 | 71µs | # spent 40µs (8+31) within Template::Constants::BEGIN@41 which was called:
# once (8µs+31µs) by Template::Base::BEGIN@24 at line 41 # spent 40µs making 1 call to Template::Constants::BEGIN@41
# spent 31µs making 1 call to constant::import |
| 42 | 3 | 28µs | 2 | 73µs | # spent 41µs (9+32) within Template::Constants::BEGIN@42 which was called:
# once (9µs+32µs) by Template::Base::BEGIN@24 at line 42 # spent 41µs making 1 call to Template::Constants::BEGIN@42
# spent 32µs making 1 call to constant::import |
| 43 | 3 | 28µs | 2 | 70µs | # spent 39µs (8+31) within Template::Constants::BEGIN@43 which was called:
# once (8µs+31µs) by Template::Base::BEGIN@24 at line 43 # spent 39µs making 1 call to Template::Constants::BEGIN@43
# spent 31µs making 1 call to constant::import |
| 44 | 3 | 39µs | 2 | 68µs | # spent 38µs (8+30) within Template::Constants::BEGIN@44 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 44 # spent 38µs making 1 call to Template::Constants::BEGIN@44
# spent 30µs making 1 call to constant::import |
| 45 | 3 | 32µs | 2 | 85µs | # spent 47µs (9+38) within Template::Constants::BEGIN@45 which was called:
# once (9µs+38µs) by Template::Base::BEGIN@24 at line 45 # spent 47µs making 1 call to Template::Constants::BEGIN@45
# spent 38µs making 1 call to constant::import |
| 46 | |||||
| 47 | # ERROR constants for indicating exception types | ||||
| 48 | 3 | 34µs | 2 | 72µs | # spent 41µs (10+31) within Template::Constants::BEGIN@48 which was called:
# once (10µs+31µs) by Template::Base::BEGIN@24 at line 48 # spent 41µs making 1 call to Template::Constants::BEGIN@48
# spent 31µs making 1 call to constant::import |
| 49 | 3 | 29µs | 2 | 70µs | # spent 39µs (9+31) within Template::Constants::BEGIN@49 which was called:
# once (9µs+31µs) by Template::Base::BEGIN@24 at line 49 # spent 39µs making 1 call to Template::Constants::BEGIN@49
# spent 31µs making 1 call to constant::import |
| 50 | 3 | 28µs | 2 | 68µs | # spent 39µs (9+30) within Template::Constants::BEGIN@50 which was called:
# once (9µs+30µs) by Template::Base::BEGIN@24 at line 50 # spent 39µs making 1 call to Template::Constants::BEGIN@50
# spent 30µs making 1 call to constant::import |
| 51 | 3 | 28µs | 2 | 69µs | # spent 39µs (8+30) within Template::Constants::BEGIN@51 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 51 # spent 39µs making 1 call to Template::Constants::BEGIN@51
# spent 30µs making 1 call to constant::import |
| 52 | 3 | 34µs | 2 | 68µs | # spent 38µs (8+30) within Template::Constants::BEGIN@52 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 52 # spent 38µs making 1 call to Template::Constants::BEGIN@52
# spent 30µs making 1 call to constant::import |
| 53 | 3 | 30µs | 2 | 77µs | # spent 45µs (14+32) within Template::Constants::BEGIN@53 which was called:
# once (14µs+32µs) by Template::Base::BEGIN@24 at line 53 # spent 45µs making 1 call to Template::Constants::BEGIN@53
# spent 32µs making 1 call to constant::import |
| 54 | 3 | 38µs | 2 | 68µs | # spent 39µs (9+30) within Template::Constants::BEGIN@54 which was called:
# once (9µs+30µs) by Template::Base::BEGIN@24 at line 54 # spent 39µs making 1 call to Template::Constants::BEGIN@54
# spent 30µs making 1 call to constant::import |
| 55 | |||||
| 56 | # CHOMP constants for PRE_CHOMP and POST_CHOMP | ||||
| 57 | 3 | 28µs | 2 | 73µs | # spent 41µs (10+31) within Template::Constants::BEGIN@57 which was called:
# once (10µs+31µs) by Template::Base::BEGIN@24 at line 57 # spent 41µs making 1 call to Template::Constants::BEGIN@57
# spent 31µs making 1 call to constant::import |
| 58 | 3 | 28µs | 2 | 70µs | # spent 39µs (9+31) within Template::Constants::BEGIN@58 which was called:
# once (9µs+31µs) by Template::Base::BEGIN@24 at line 58 # spent 39µs making 1 call to Template::Constants::BEGIN@58
# spent 31µs making 1 call to constant::import |
| 59 | 3 | 29µs | 2 | 69µs | # spent 39µs (9+30) within Template::Constants::BEGIN@59 which was called:
# once (9µs+30µs) by Template::Base::BEGIN@24 at line 59 # spent 39µs making 1 call to Template::Constants::BEGIN@59
# spent 30µs making 1 call to constant::import |
| 60 | 3 | 33µs | 2 | 68µs | # spent 38µs (8+30) within Template::Constants::BEGIN@60 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 60 # spent 38µs making 1 call to Template::Constants::BEGIN@60
# spent 30µs making 1 call to constant::import |
| 61 | 3 | 35µs | 2 | 82µs | # spent 52µs (21+31) within Template::Constants::BEGIN@61 which was called:
# once (21µs+31µs) by Template::Base::BEGIN@24 at line 61 # spent 52µs making 1 call to Template::Constants::BEGIN@61
# spent 31µs making 1 call to constant::import |
| 62 | |||||
| 63 | # DEBUG constants to enable various debugging options | ||||
| 64 | 3 | 34µs | 2 | 73µs | # spent 41µs (8+32) within Template::Constants::BEGIN@64 which was called:
# once (8µs+32µs) by Template::Base::BEGIN@24 at line 64 # spent 41µs making 1 call to Template::Constants::BEGIN@64
# spent 33µs making 1 call to constant::import |
| 65 | 3 | 28µs | 2 | 71µs | # spent 40µs (9+31) within Template::Constants::BEGIN@65 which was called:
# once (9µs+31µs) by Template::Base::BEGIN@24 at line 65 # spent 40µs making 1 call to Template::Constants::BEGIN@65
# spent 31µs making 1 call to constant::import |
| 66 | 3 | 28µs | 2 | 68µs | # spent 38µs (8+30) within Template::Constants::BEGIN@66 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 66 # spent 38µs making 1 call to Template::Constants::BEGIN@66
# spent 30µs making 1 call to constant::import |
| 67 | 3 | 30µs | 2 | 72µs | # spent 40µs (8+32) within Template::Constants::BEGIN@67 which was called:
# once (8µs+32µs) by Template::Base::BEGIN@24 at line 67 # spent 40µs making 1 call to Template::Constants::BEGIN@67
# spent 32µs making 1 call to constant::import |
| 68 | 3 | 32µs | 2 | 74µs | # spent 44µs (14+30) within Template::Constants::BEGIN@68 which was called:
# once (14µs+30µs) by Template::Base::BEGIN@24 at line 68 # spent 44µs making 1 call to Template::Constants::BEGIN@68
# spent 30µs making 1 call to constant::import |
| 69 | 3 | 41µs | 2 | 71µs | # spent 40µs (9+31) within Template::Constants::BEGIN@69 which was called:
# once (9µs+31µs) by Template::Base::BEGIN@24 at line 69 # spent 40µs making 1 call to Template::Constants::BEGIN@69
# spent 31µs making 1 call to constant::import |
| 70 | 3 | 31µs | 2 | 87µs | # spent 53µs (20+34) within Template::Constants::BEGIN@70 which was called:
# once (20µs+34µs) by Template::Base::BEGIN@24 at line 70 # spent 53µs making 1 call to Template::Constants::BEGIN@70
# spent 34µs making 1 call to constant::import |
| 71 | 3 | 29µs | 2 | 71µs | # spent 40µs (9+31) within Template::Constants::BEGIN@71 which was called:
# once (9µs+31µs) by Template::Base::BEGIN@24 at line 71 # spent 40µs making 1 call to Template::Constants::BEGIN@71
# spent 31µs making 1 call to constant::import |
| 72 | 3 | 29µs | 2 | 69µs | # spent 39µs (8+30) within Template::Constants::BEGIN@72 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 72 # spent 39µs making 1 call to Template::Constants::BEGIN@72
# spent 30µs making 1 call to constant::import |
| 73 | 3 | 28µs | 2 | 67µs | # spent 38µs (9+29) within Template::Constants::BEGIN@73 which was called:
# once (9µs+29µs) by Template::Base::BEGIN@24 at line 73 # spent 38µs making 1 call to Template::Constants::BEGIN@73
# spent 29µs making 1 call to constant::import |
| 74 | 3 | 28µs | 2 | 68µs | # spent 38µs (8+30) within Template::Constants::BEGIN@74 which was called:
# once (8µs+30µs) by Template::Base::BEGIN@24 at line 74 # spent 38µs making 1 call to Template::Constants::BEGIN@74
# spent 30µs making 1 call to constant::import |
| 75 | 3 | 36µs | 2 | 91µs | # spent 50µs (9+41) within Template::Constants::BEGIN@75 which was called:
# once (9µs+41µs) by Template::Base::BEGIN@24 at line 75 # spent 50µs making 1 call to Template::Constants::BEGIN@75
# spent 41µs making 1 call to constant::import |
| 76 | 3 | 39µs | 2 | 75µs | # spent 42µs (10+33) within Template::Constants::BEGIN@76 which was called:
# once (10µs+33µs) by Template::Base::BEGIN@24 at line 76 # spent 42µs making 1 call to Template::Constants::BEGIN@76
# spent 33µs making 1 call to constant::import |
| 77 | |||||
| 78 | # extra debugging flags | ||||
| 79 | 3 | 30µs | 2 | 73µs | # spent 40µs (8+32) within Template::Constants::BEGIN@79 which was called:
# once (8µs+32µs) by Template::Base::BEGIN@24 at line 79 # spent 40µs making 1 call to Template::Constants::BEGIN@79
# spent 32µs making 1 call to constant::import |
| 80 | 3 | 572µs | 2 | 70µs | # spent 39µs (9+30) within Template::Constants::BEGIN@80 which was called:
# once (9µs+30µs) by Template::Base::BEGIN@24 at line 80 # spent 39µs making 1 call to Template::Constants::BEGIN@80
# spent 31µs making 1 call to constant::import |
| 81 | |||||
| 82 | 1 | 127µs | 28 | 19µs | $DEBUG_OPTIONS = { # spent 4µs making 2 calls to Template::Constants::DEBUG_OFF, avg 2µs/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_DIRS, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_FILTERS, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_ON, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_PARSER, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_PROVIDER, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_UNDEF, avg 600ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_ALL, avg 550ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_CONTEXT, avg 550ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_PLUGINS, avg 550ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_STASH, avg 550ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_VARS, avg 550ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_CALLER, avg 500ns/call
# spent 1µs making 2 calls to Template::Constants::DEBUG_SERVICE, avg 500ns/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 | |||||
| 99 | 1 | 2µs | @STATUS = qw( STATUS_OK STATUS_RETURN STATUS_STOP STATUS_DONE | ||
| 100 | STATUS_DECLINED STATUS_ERROR ); | ||||
| 101 | 1 | 2µs | @ERROR = qw( ERROR_FILE ERROR_VIEW ERROR_UNDEF ERROR_PERL | ||
| 102 | ERROR_RETURN ERROR_FILTER ERROR_PLUGIN ); | ||||
| 103 | 1 | 1µs | @CHOMP = qw( CHOMP_NONE CHOMP_ALL CHOMP_ONE CHOMP_COLLAPSE CHOMP_GREEDY ); | ||
| 104 | 1 | 5µ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 | |||||
| 109 | 1 | 8µs | @EXPORT_OK = ( @STATUS, @ERROR, @CHOMP, @DEBUG ); | ||
| 110 | 1 | 14µs | %EXPORT_TAGS = ( | ||
| 111 | 'all' => [ @EXPORT_OK ], | ||||
| 112 | 'status' => [ @STATUS ], | ||||
| 113 | 'error' => [ @ERROR ], | ||||
| 114 | 'chomp' => [ @CHOMP ], | ||||
| 115 | 'debug' => [ @DEBUG ], | ||||
| 116 | ); | ||||
| 117 | |||||
| 118 | |||||
| 119 | sub 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 | |||||
| 157 | 1 | 24µs | 1; | ||
| 158 | |||||
| 159 | __END__ | ||||
# spent 1µs within Template::Constants::DEBUG_ALL which was called 2 times, avg 550ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 550ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_CALLER which was called 2 times, avg 500ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 500ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_CONTEXT which was called 2 times, avg 550ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 550ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_DIRS which was called 2 times, avg 600ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_FILTERS which was called 2 times, avg 600ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call | |||||
# spent 4µs within Template::Constants::DEBUG_OFF which was called 2 times, avg 2µs/call:
# 2 times (4µs+0s) by Template::Base::BEGIN@24 at line 82, avg 2µs/call | |||||
# spent 1µs within Template::Constants::DEBUG_ON which was called 2 times, avg 600ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_PARSER which was called 2 times, avg 600ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_PLUGINS which was called 2 times, avg 550ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 550ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_PROVIDER which was called 2 times, avg 600ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_SERVICE which was called 2 times, avg 500ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 500ns/call | |||||
# spent 1µs within Template::Constants::DEBUG_STASH which was called 2 times, avg 550ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 550ns/call | |||||
# spent 7µs within Template::Constants::DEBUG_UNDEF which was called 3 times, avg 2µs/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 600ns/call
# once (6µs+0s) by Template::Context::_init at line 860 of Template/Context.pm | |||||
# spent 1µs within Template::Constants::DEBUG_VARS which was called 2 times, avg 550ns/call:
# 2 times (1µs+0s) by Template::Base::BEGIN@24 at line 82, avg 550ns/call |