Filename | /usr/share/perl/5.20/locale.pm |
Statements | Executed 11 statements in 197µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 22µs | 37µs | BEGIN@4 | locale::
1 | 1 | 1 | 3µs | 3µs | import | locale::
0 | 0 | 0 | 0s | 0s | unimport | locale::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package locale; | ||||
2 | |||||
3 | 1 | 400ns | our $VERSION = '1.03'; | ||
4 | 2 | 187µs | 2 | 52µs | # spent 37µs (22+15) within locale::BEGIN@4 which was called:
# once (22µs+15µs) by Template::Filters::BEGIN@24 at line 4 # spent 37µs making 1 call to locale::BEGIN@4
# spent 15µs making 1 call to Config::import |
5 | |||||
6 | 1 | 900ns | $Carp::Internal{ (__PACKAGE__) } = 1; | ||
7 | |||||
8 | # A separate bit is used for each of the two forms of the pragma, as they are | ||||
9 | # mostly independent, and interact with each other and the unicode_strings | ||||
10 | # feature. This allows for fast determination of which one(s) of the three | ||||
11 | # are to be used at any given point, and no code has to be written to deal | ||||
12 | # with coming in and out of scopes--it falls automatically out from the hint | ||||
13 | # handling | ||||
14 | |||||
15 | 1 | 100ns | $locale::hint_bits = 0x4; | ||
16 | 1 | 100ns | $locale::not_chars_hint_bits = 0x10; | ||
17 | |||||
18 | # spent 3µs within locale::import which was called:
# once (3µs+0s) by Template::Filters::BEGIN@24 at line 24 of Template/Filters.pm | ||||
19 | 1 | 200ns | shift; # should be 'locale'; not checked | ||
20 | |||||
21 | 1 | 200ns | my $found_not_chars = 0; | ||
22 | 1 | 700ns | while (defined (my $arg = shift)) { | ||
23 | if ($arg eq ":not_characters") { | ||||
24 | $^H |= $locale::not_chars_hint_bits; | ||||
25 | |||||
26 | # This form of the pragma overrides the other | ||||
27 | $^H &= ~$locale::hint_bits; | ||||
28 | $found_not_chars = 1; | ||||
29 | } | ||||
30 | else { | ||||
31 | require Carp; | ||||
32 | Carp::croak("Unknown parameter '$arg' to 'use locale'"); | ||||
33 | } | ||||
34 | } | ||||
35 | |||||
36 | # Use the plain form if not doing the :not_characters one. | ||||
37 | 1 | 5µs | $^H |= $locale::hint_bits unless $found_not_chars; | ||
38 | } | ||||
39 | |||||
40 | sub unimport { | ||||
41 | $^H &= ~($locale::hint_bits|$locale::not_chars_hint_bits); | ||||
42 | } | ||||
43 | |||||
44 | 1 | 3µs | 1; |