| Filename | /usr/lib/perl5/5.14/constant.pm | 
| Statements | Executed 2751 statements in 8.07ms | 
| Calls | P | F | Exclusive Time | Inclusive Time | Subroutine | 
|---|---|---|---|---|---|
| 109 | 109 | 6 | 4.61ms | 5.75ms | constant::import | 
| 112 | 4 | 1 | 313µs | 313µs | constant::CORE:regcomp (opcode) | 
| 109 | 1 | 1 | 293µs | 293µs | constant::CORE:match (opcode) | 
| 1 | 1 | 1 | 239µs | 239µs | constant::BEGIN@2 | 
| 1 | 1 | 1 | 23µs | 23µs | constant::BEGIN@25 | 
| 3 | 3 | 1 | 18µs | 18µs | constant::CORE:qr (opcode) | 
| 1 | 1 | 1 | 16µs | 82µs | constant::BEGIN@6 | 
| 1 | 1 | 1 | 15µs | 20µs | constant::BEGIN@3 | 
| 1 | 1 | 1 | 14µs | 209µs | constant::BEGIN@4 | 
| 1 | 1 | 1 | 13µs | 30µs | constant::BEGIN@114 | 
| 1 | 1 | 1 | 12µs | 29µs | constant::BEGIN@52 | 
| 1 | 1 | 1 | 12µs | 31µs | constant::BEGIN@29 | 
| 0 | 0 | 0 | 0s | 0s | constant::__ANON__[:136] | 
| 0 | 0 | 0 | 0s | 0s | constant::__ANON__[:140] | 
| 0 | 0 | 0 | 0s | 0s | constant::__ANON__[:142] | 
| 0 | 0 | 0 | 0s | 0s | constant::__ANON__[:31] | 
| Line | State ments | Time on line | Calls | Time in subs | Code | 
|---|---|---|---|---|---|
| 1 | package constant; | ||||
| 2 | 2 | 194µs | 1 | 239µs | # spent 239µs within constant::BEGIN@2 which was called:
#    once (239µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 2 # spent   239µs making 1 call to constant::BEGIN@2 | 
| 3 | 2 | 56µs | 2 | 24µs | # spent 20µs (15+5) within constant::BEGIN@3 which was called:
#    once (15µs+5µs) by Compress::Raw::Zlib::BEGIN@71 at line 3 # spent    20µs making 1 call to constant::BEGIN@3
# spent     5µs making 1 call to strict::import | 
| 4 | 2 | 60µs | 2 | 404µs | # spent 209µs (14+195) within constant::BEGIN@4 which was called:
#    once (14µs+195µs) by Compress::Raw::Zlib::BEGIN@71 at line 4 # spent   209µs making 1 call to constant::BEGIN@4
# spent   195µs making 1 call to warnings::register::import | 
| 5 | |||||
| 6 | 2 | 252µs | 2 | 147µs | # spent 82µs (16+66) within constant::BEGIN@6 which was called:
#    once (16µs+66µs) by Compress::Raw::Zlib::BEGIN@71 at line 6 # spent    82µs making 1 call to constant::BEGIN@6
# spent    66µs making 1 call to vars::import | 
| 7 | 1 | 1µs | $VERSION = '1.21'; | ||
| 8 | |||||
| 9 | #======================================================================= | ||||
| 10 | |||||
| 11 | # Some names are evil choices. | ||||
| 12 | 1 | 12µs | my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD }; | ||
| 13 | 1 | 2µs | $keywords{UNITCHECK}++ if $] > 5.009; | ||
| 14 | |||||
| 15 | 1 | 13µs | my %forced_into_main = map +($_, 1), | ||
| 16 | qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG }; | ||||
| 17 | |||||
| 18 | 1 | 9µs | my %forbidden = (%keywords, %forced_into_main); | ||
| 19 | |||||
| 20 | 1 | 2µs | my $str_end = $] >= 5.006 ? "\\z" : "\\Z"; | ||
| 21 | 1 | 52µs | 2 | 36µs | my $normal_constant_name = qr/^_?[^\W_0-9]\w*$str_end/; # spent    24µs making 1 call to constant::CORE:regcomp
# spent    12µs making 1 call to constant::CORE:qr | 
| 22 | 1 | 22µs | 2 | 14µs | my $tolerable = qr/^[A-Za-z_]\w*$str_end/; # spent    11µs making 1 call to constant::CORE:regcomp
# spent     3µs making 1 call to constant::CORE:qr | 
| 23 | 1 | 21µs | 2 | 13µs | my $boolean = qr/^[01]?$str_end/; # spent    10µs making 1 call to constant::CORE:regcomp
# spent     3µs making 1 call to constant::CORE:qr | 
| 24 | |||||
| 25 | # spent 23µs within constant::BEGIN@25 which was called:
#    once (23µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 32 | ||||
| 26 | # We'd like to do use constant _CAN_PCS => $] > 5.009002 | ||||
| 27 | # but that's a bit tricky before we load the constant module :-) | ||||
| 28 | # By doing this, we save 1 run time check for *every* call to import. | ||||
| 29 | 2 | 92µs | 2 | 50µs | # spent 31µs (12+19) within constant::BEGIN@29 which was called:
#    once (12µs+19µs) by Compress::Raw::Zlib::BEGIN@71 at line 29     # spent    31µs making 1 call to constant::BEGIN@29
    # spent    19µs making 1 call to strict::unimport | 
| 30 | 2 | 24µs | my $const = $] > 5.009002; | ||
| 31 | *_CAN_PCS = sub () {$const}; | ||||
| 32 | 1 | 136µs | 1 | 23µs | } # spent    23µs making 1 call to constant::BEGIN@25 | 
| 33 | |||||
| 34 | #======================================================================= | ||||
| 35 | # import() - import symbols into user's namespace | ||||
| 36 | # | ||||
| 37 | # What we actually do is define a function in the caller's namespace | ||||
| 38 | # which returns the value. The function we create will normally | ||||
| 39 | # be inlined as a constant, thereby avoiding further sub calling | ||||
| 40 | # overhead. | ||||
| 41 | #======================================================================= | ||||
| 42 | # spent 5.75ms (4.61+1.14) within constant::import which was called 109 times, avg 53µs/call:
#    once (116µs+35µs) by Archive::Zip::BEGIN@158 at line 158 of Archive/Zip.pm
#    once (68µs+23µs) by Compress::Raw::Zlib::BEGIN@71 at line 71 of Compress/Raw/Zlib.pm
#    once (60µs+19µs) by File::stat::BEGIN@143 at line 143 of File/stat.pm
#    once (59µs+19µs) by Archive::Zip::BEGIN@149 at line 149 of Archive/Zip.pm
#    once (61µs+16µs) by Time::Local::BEGIN@27 at line 27 of Time/Local.pm
#    once (57µs+17µs) by File::Temp::BEGIN@217 at line 217 of File/Temp.pm
#    once (48µs+12µs) by Archive::Zip::Member::BEGIN@26 at line 26 of Archive/Zip/Member.pm
#    once (43µs+16µs) by Compress::Raw::Zlib::BEGIN@107 at line 107 of Compress/Raw/Zlib.pm
#    once (46µs+9µs) by Archive::Zip::BEGIN@236 at line 236 of Archive/Zip.pm
#    once (44µs+10µs) by Archive::Zip::BEGIN@159 at line 159 of Archive/Zip.pm
#    once (43µs+11µs) by Compress::Raw::Zlib::BEGIN@72 at line 72 of Compress/Raw/Zlib.pm
#    once (44µs+10µs) by Archive::Zip::BEGIN@233 at line 233 of Archive/Zip.pm
#    once (43µs+11µs) by Archive::Zip::BEGIN@150 at line 150 of Archive/Zip.pm
#    once (44µs+9µs) by Archive::Zip::BEGIN@161 at line 161 of Archive/Zip.pm
#    once (44µs+9µs) by Compress::Raw::Zlib::BEGIN@103 at line 103 of Compress/Raw/Zlib.pm
#    once (44µs+9µs) by Archive::Zip::BEGIN@211 at line 211 of Archive/Zip.pm
#    once (42µs+11µs) by Archive::Zip::BEGIN@162 at line 162 of Archive/Zip.pm
#    once (44µs+9µs) by Archive::Zip::BEGIN@190 at line 190 of Archive/Zip.pm
#    once (43µs+10µs) by Archive::Zip::BEGIN@216 at line 216 of Archive/Zip.pm
#    once (42µs+10µs) by Compress::Raw::Zlib::BEGIN@86 at line 86 of Compress/Raw/Zlib.pm
#    once (42µs+10µs) by Archive::Zip::Member::BEGIN@27 at line 27 of Archive/Zip/Member.pm
#    once (42µs+10µs) by Archive::Zip::Member::BEGIN@29 at line 29 of Archive/Zip/Member.pm
#    once (41µs+11µs) by Archive::Zip::BEGIN@163 at line 163 of Archive/Zip.pm
#    once (42µs+10µs) by Archive::Zip::BEGIN@196 at line 196 of Archive/Zip.pm
#    once (42µs+10µs) by Archive::Zip::BEGIN@244 at line 244 of Archive/Zip.pm
#    once (42µs+10µs) by Compress::Raw::Zlib::BEGIN@112 at line 112 of Compress/Raw/Zlib.pm
#    once (42µs+10µs) by File::Temp::BEGIN@228 at line 228 of File/Temp.pm
#    once (42µs+10µs) by File::Temp::BEGIN@220 at line 220 of File/Temp.pm
#    once (42µs+10µs) by Archive::Zip::BEGIN@166 at line 166 of Archive/Zip.pm
#    once (43µs+9µs) by Archive::Zip::BEGIN@207 at line 207 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::Member::BEGIN@34 at line 34 of Archive/Zip/Member.pm
#    once (42µs+10µs) by Archive::Zip::BEGIN@170 at line 170 of Archive/Zip.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@208 at line 208 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@167 at line 167 of Archive/Zip.pm
#    once (40µs+11µs) by Compress::Raw::Zlib::BEGIN@84 at line 84 of Compress/Raw/Zlib.pm
#    once (42µs+9µs) by Compress::Raw::Zlib::BEGIN@113 at line 113 of Compress/Raw/Zlib.pm
#    once (41µs+10µs) by Archive::Zip::Member::BEGIN@32 at line 32 of Archive/Zip/Member.pm
#    once (41µs+10µs) by Archive::Zip::Member::BEGIN@28 at line 28 of Archive/Zip/Member.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@160 at line 160 of Archive/Zip.pm
#    once (42µs+10µs) by Time::Local::BEGIN@28 at line 28 of Time/Local.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@188 at line 188 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@181 at line 181 of Archive/Zip.pm
#    once (41µs+10µs) by File::Temp::BEGIN@229 at line 229 of File/Temp.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@240 at line 240 of Archive/Zip.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@221 at line 221 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@169 at line 169 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@164 at line 164 of Archive/Zip.pm
#    once (40µs+11µs) by Archive::Zip::BEGIN@151 at line 151 of Archive/Zip.pm
#    once (39µs+11µs) by Compress::Raw::Zlib::BEGIN@102 at line 102 of Compress/Raw/Zlib.pm
#    once (41µs+10µs) by Compress::Raw::Zlib::BEGIN@104 at line 104 of Compress/Raw/Zlib.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@232 at line 232 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@246 at line 246 of Archive/Zip.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@249 at line 249 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@235 at line 235 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::Member::BEGIN@35 at line 35 of Archive/Zip/Member.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@174 at line 174 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@229 at line 229 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@165 at line 165 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@183 at line 183 of Archive/Zip.pm
#    once (41µs+10µs) by Archive::Zip::BEGIN@168 at line 168 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@189 at line 189 of Archive/Zip.pm
#    once (42µs+9µs) by Archive::Zip::BEGIN@238 at line 238 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@251 at line 251 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@172 at line 172 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@152 at line 152 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@212 at line 212 of Archive/Zip.pm
#    once (40µs+10µs) by Compress::Raw::Zlib::BEGIN@105 at line 105 of Compress/Raw/Zlib.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@206 at line 206 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@250 at line 250 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@245 at line 245 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@176 at line 176 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@230 at line 230 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@228 at line 228 of Archive/Zip.pm
#    once (41µs+9µs) by Archive::Zip::BEGIN@199 at line 199 of Archive/Zip.pm
#    once (39µs+10µs) by Archive::Zip::BEGIN@153 at line 153 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@222 at line 222 of Archive/Zip.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@226 at line 226 of Archive/Zip.pm
#    once (40µs+10µs) by Archive::Zip::BEGIN@173 at line 173 of Archive/Zip.pm
#    once (40µs+10µs) by Compress::Raw::Zlib::BEGIN@111 at line 111 of Compress/Raw/Zlib.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@247 at line 247 of Archive/Zip.pm
#    once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@88 at line 88 of Compress/Raw/Zlib.pm
#    once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@85 at line 85 of Compress/Raw/Zlib.pm
#    once (39µs+10µs) by Archive::Zip::BEGIN@175 at line 175 of Archive/Zip.pm
#    once (39µs+10µs) by Compress::Raw::Zlib::BEGIN@116 at line 116 of Compress/Raw/Zlib.pm
#    once (37µs+12µs) by Archive::Zip::Member::BEGIN@33 at line 33 of Archive/Zip/Member.pm
#    once (39µs+10µs) by Archive::Zip::BEGIN@243 at line 243 of Archive/Zip.pm
#    once (39µs+10µs) by File::Temp::BEGIN@224 at line 224 of File/Temp.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@262 at line 262 of Archive/Zip.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@248 at line 248 of Archive/Zip.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@182 at line 182 of Archive/Zip.pm
#    once (40µs+9µs) by Archive::Zip::BEGIN@191 at line 191 of Archive/Zip.pm
#    once (40µs+9µs) by Compress::Raw::Zlib::BEGIN@109 at line 109 of Compress/Raw/Zlib.pm
#    once (39µs+9µs) by Archive::Zip::BEGIN@217 at line 217 of Archive/Zip.pm
#    once (39µs+10µs) by Compress::Raw::Zlib::BEGIN@115 at line 115 of Compress/Raw/Zlib.pm
#    once (39µs+9µs) by Compress::Raw::Zlib::BEGIN@114 at line 114 of Compress/Raw/Zlib.pm
#    once (38µs+10µs) by Archive::Zip::BEGIN@201 at line 201 of Archive/Zip.pm
#    once (39µs+10µs) by Archive::Zip::BEGIN@263 at line 263 of Archive/Zip.pm
#    once (38µs+10µs) by Archive::Zip::BEGIN@198 at line 198 of Archive/Zip.pm
#    once (38µs+10µs) by Archive::Zip::BEGIN@197 at line 197 of Archive/Zip.pm
#    once (39µs+9µs) by Archive::Zip::BEGIN@171 at line 171 of Archive/Zip.pm
#    once (38µs+10µs) by Compress::Raw::Zlib::BEGIN@87 at line 87 of Compress/Raw/Zlib.pm
#    once (38µs+10µs) by Archive::Zip::BEGIN@200 at line 200 of Archive/Zip.pm
#    once (39µs+9µs) by Archive::Zip::BEGIN@215 at line 215 of Archive/Zip.pm
#    once (38µs+9µs) by Compress::Raw::Zlib::BEGIN@106 at line 106 of Compress/Raw/Zlib.pm
#    once (38µs+10µs) by Time::Local::BEGIN@29 at line 29 of Time/Local.pm
#    once (38µs+9µs) by Archive::Zip::BEGIN@225 at line 225 of Archive/Zip.pm
#    once (37µs+10µs) by Archive::Zip::BEGIN@239 at line 239 of Archive/Zip.pm
#    once (37µs+10µs) by File::Temp::BEGIN@230 at line 230 of File/Temp.pm
#    once (36µs+10µs) by Archive::Zip::BEGIN@220 at line 220 of Archive/Zip.pm | ||||
| 43 | 1199 | 2.15ms | my $class = shift; | ||
| 44 | return unless @_; # Ignore 'use constant;' | ||||
| 45 | my $constants; | ||||
| 46 | my $multiple = ref $_[0]; | ||||
| 47 | my $pkg = caller; | ||||
| 48 | my $flush_mro; | ||||
| 49 | my $symtab; | ||||
| 50 | |||||
| 51 | 109 | 213µs | if (_CAN_PCS) { | ||
| 52 | 2 | 530µs | 2 | 45µs | # spent 29µs (12+17) within constant::BEGIN@52 which was called:
#    once (12µs+17µs) by Compress::Raw::Zlib::BEGIN@71 at line 52         # spent    29µs making 1 call to constant::BEGIN@52
        # spent    17µs making 1 call to strict::unimport | 
| 53 | $symtab = \%{$pkg . '::'}; | ||||
| 54 | }; | ||||
| 55 | |||||
| 56 | 218 | 279µs | if ( $multiple ) { | ||
| 57 | if (ref $_[0] ne 'HASH') { | ||||
| 58 | require Carp; | ||||
| 59 | Carp::croak("Invalid reference type '".ref(shift)."' not 'HASH'"); | ||||
| 60 | } | ||||
| 61 | $constants = shift; | ||||
| 62 | } else { | ||||
| 63 | unless (defined $_[0]) { | ||||
| 64 | require Carp; | ||||
| 65 | Carp::croak("Can't use undef as constant name"); | ||||
| 66 | } | ||||
| 67 | $constants->{+shift} = undef; | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | foreach my $name ( keys %$constants ) { | ||||
| 71 | # Normal constant name | ||||
| 72 | 218 | 1.55ms | 218 | 561µs | if ($name =~ $normal_constant_name and !$forbidden{$name}) {         # spent   293µs making 109 calls to constant::CORE:match, avg 3µs/call
        # spent   268µs making 109 calls to constant::CORE:regcomp, avg 2µs/call | 
| 73 | # Everything is okay | ||||
| 74 | |||||
| 75 | # Name forced into main, but we're not in main. Fatal. | ||||
| 76 | } elsif ($forced_into_main{$name} and $pkg ne 'main') { | ||||
| 77 | require Carp; | ||||
| 78 | Carp::croak("Constant name '$name' is forced into main::"); | ||||
| 79 | |||||
| 80 | # Starts with double underscore. Fatal. | ||||
| 81 | } elsif ($name =~ /^__/) { | ||||
| 82 | require Carp; | ||||
| 83 | Carp::croak("Constant name '$name' begins with '__'"); | ||||
| 84 | |||||
| 85 | # Maybe the name is tolerable | ||||
| 86 | } elsif ($name =~ $tolerable) { | ||||
| 87 | # Then we'll warn only if you've asked for warnings | ||||
| 88 | if (warnings::enabled()) { | ||||
| 89 | if ($keywords{$name}) { | ||||
| 90 | warnings::warn("Constant name '$name' is a Perl keyword"); | ||||
| 91 | } elsif ($forced_into_main{$name}) { | ||||
| 92 | warnings::warn("Constant name '$name' is " . | ||||
| 93 | "forced into package main::"); | ||||
| 94 | } | ||||
| 95 | } | ||||
| 96 | |||||
| 97 | # Looks like a boolean | ||||
| 98 | # use constant FRED == fred; | ||||
| 99 | } elsif ($name =~ $boolean) { | ||||
| 100 | require Carp; | ||||
| 101 | if (@_) { | ||||
| 102 | Carp::croak("Constant name '$name' is invalid"); | ||||
| 103 | } else { | ||||
| 104 | Carp::croak("Constant name looks like boolean value"); | ||||
| 105 | } | ||||
| 106 | |||||
| 107 | } else { | ||||
| 108 | # Must have bad characters | ||||
| 109 | require Carp; | ||||
| 110 | Carp::croak("Constant name '$name' has invalid characters"); | ||||
| 111 | } | ||||
| 112 | |||||
| 113 | { | ||||
| 114 | 2 | 464µs | 2 | 48µs | # spent 30µs (13+17) within constant::BEGIN@114 which was called:
#    once (13µs+17µs) by Compress::Raw::Zlib::BEGIN@71 at line 114             # spent    30µs making 1 call to constant::BEGIN@114
            # spent    17µs making 1 call to strict::unimport | 
| 115 | 327 | 441µs | my $full_name = "${pkg}::$name"; | ||
| 116 | $declared{$full_name}++; | ||||
| 117 | 327 | 761µs | if ($multiple || @_ == 1) { | ||
| 118 | my $scalar = $multiple ? $constants->{$name} : $_[0]; | ||||
| 119 | |||||
| 120 | # Work around perl bug #xxxxx: Sub names (actually glob | ||||
| 121 | # names in general) ignore the UTF8 flag. So we have to | ||||
| 122 | # turn it off to get the "right" symbol table entry. | ||||
| 123 | 109 | 167µs | utf8::is_utf8 $name and utf8::encode $name;                 # spent   167µs making 109 calls to utf8::is_utf8, avg 2µs/call | ||
| 124 | |||||
| 125 | # The constant serves to optimise this entire block out on | ||||
| 126 | # 5.8 and earlier. | ||||
| 127 | 327 | 688µs | if (_CAN_PCS && $symtab && !exists $symtab->{$name}) { | ||
| 128 | # No typeglob yet, so we can use a reference as space- | ||||
| 129 | # efficient proxy for a constant subroutine | ||||
| 130 | # The check in Perl_ck_rvconst knows that inlinable | ||||
| 131 | # constants from cv_const_sv are read only. So we have to: | ||||
| 132 | 109 | 152µs | Internals::SvREADONLY($scalar, 1);                     # spent   152µs making 109 calls to Internals::SvREADONLY, avg 1µs/call | ||
| 133 | $symtab->{$name} = \$scalar; | ||||
| 134 | ++$flush_mro; | ||||
| 135 | } else { | ||||
| 136 | *$full_name = sub () { $scalar }; | ||||
| 137 | } | ||||
| 138 | } elsif (@_) { | ||||
| 139 | my @list = @_; | ||||
| 140 | *$full_name = sub () { @list }; | ||||
| 141 | } else { | ||||
| 142 | *$full_name = sub () { }; | ||||
| 143 | } | ||||
| 144 | } | ||||
| 145 | } | ||||
| 146 | # Flush the cache exactly once if we make any direct symbol table changes. | ||||
| 147 | 109 | 260µs | mro::method_changed_in($pkg) if _CAN_PCS && $flush_mro;     # spent   260µs making 109 calls to mro::method_changed_in, avg 2µs/call | ||
| 148 | } | ||||
| 149 | |||||
| 150 | 1 | 53µs | 1; | ||
| 151 | |||||
| 152 | __END__ | ||||
| # spent 293µs within constant::CORE:match which was called 109 times, avg 3µs/call:
# 109 times (293µs+0s) by constant::import at line 72, avg 3µs/call | |||||
| sub constant::CORE:qr; # opcode | |||||
| # spent 313µs within constant::CORE:regcomp which was called 112 times, avg 3µs/call:
# 109 times (268µs+0s) by constant::import at line 72, avg 2µs/call
#      once (24µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 21
#      once (11µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 22
#      once (10µs+0s) by Compress::Raw::Zlib::BEGIN@71 at line 23 |