Filename | /usr/share/perl/5.20/locale.pm |
Statements | Executed 0 statements in 0s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 17µs | 30µs | BEGIN@4 | locale::
1 | 1 | 1 | 4µs | 4µ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 | our $VERSION = '1.03'; | ||||
4 | 2 | 43µs | # spent 30µs (17+13) within locale::BEGIN@4 which was called:
# once (17µs+13µs) by Template::Filters::BEGIN@24 at line 4 # spent 30µs making 1 call to locale::BEGIN@4
# spent 13µs making 1 call to Config::import | ||
5 | |||||
6 | $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 | $locale::hint_bits = 0x4; | ||||
16 | $locale::not_chars_hint_bits = 0x10; | ||||
17 | |||||
18 | # spent 4µs within locale::import which was called:
# once (4µs+0s) by Template::Filters::BEGIN@24 at line 24 of Template/Filters.pm | ||||
19 | shift; # should be 'locale'; not checked | ||||
20 | |||||
21 | my $found_not_chars = 0; | ||||
22 | 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 | $^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; |