Filename | /usr/lib64/perl5/5.16.0/warnings/register.pm |
Statements | Executed 28 statements in 342µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
5 | 5 | 5 | 292µs | 3.23ms | import | warnings::register::
0 | 0 | 0 | 0s | 0s | mkMask | warnings::register::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package warnings::register; | ||||
2 | |||||
3 | 1 | 4µs | our $VERSION = '1.02'; | ||
4 | |||||
5 | =pod | ||||
6 | |||||
7 | =head1 NAME | ||||
8 | |||||
9 | warnings::register - warnings import function | ||||
10 | |||||
11 | =head1 SYNOPSIS | ||||
12 | |||||
13 | use warnings::register; | ||||
14 | |||||
15 | =head1 DESCRIPTION | ||||
16 | |||||
17 | Creates a warnings category with the same name as the current package. | ||||
18 | |||||
19 | See L<warnings> and L<perllexwarn> for more information on this module's | ||||
20 | usage. | ||||
21 | |||||
22 | =cut | ||||
23 | |||||
24 | 1 | 3µs | require warnings; | ||
25 | |||||
26 | # left here as cruft in case other users were using this undocumented routine | ||||
27 | # -- rjbs, 2010-09-08 | ||||
28 | sub mkMask | ||||
29 | { | ||||
30 | my ($bit) = @_; | ||||
31 | my $mask = ""; | ||||
32 | |||||
33 | vec($mask, $bit, 1) = 1; | ||||
34 | return $mask; | ||||
35 | } | ||||
36 | |||||
37 | sub import | ||||
38 | # spent 3.23ms (292µs+2.94) within warnings::register::import which was called 5 times, avg 646µs/call:
# once (65µs+643µs) by vars::BEGIN@7 at line 7 of vars.pm
# once (70µs+578µs) by overload::BEGIN@146 at line 146 of overload.pm
# once (54µs+582µs) by Socket::BEGIN@684 at line 684 of Socket.pm
# once (51µs+570µs) by Tie::Hash::BEGIN@189 at line 189 of Tie/Hash.pm
# once (53µs+566µs) by constant::BEGIN@4 at line 4 of constant.pm | ||||
39 | 5 | 7µs | shift; | ||
40 | 5 | 29µs | my @categories = @_; | ||
41 | |||||
42 | 5 | 92µs | my $package = (caller(0))[0]; | ||
43 | 5 | 58µs | 5 | 2.94ms | warnings::register_categories($package); # spent 2.94ms making 5 calls to warnings::register_categories, avg 588µs/call |
44 | |||||
45 | 5 | 135µs | warnings::register_categories($package . "::$_") for @categories; | ||
46 | } | ||||
47 | |||||
48 | 1 | 13µs | 1; |