Filename | /usr/lib/perl5/5.14/warnings/register.pm |
Statements | Executed 38 statements in 190µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
7 | 7 | 7 | 166µs | 1.46ms | 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 | 2µ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 | 1µ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 1.46ms (166µs+1.29) within warnings::register::import which was called 7 times, avg 209µs/call:
# once (28µs+195µs) by vars::BEGIN@7 at line 7 of vars.pm
# once (25µs+192µs) by File::stat::BEGIN@6 at line 6 of File/stat.pm
# once (24µs+193µs) by Tie::Hash::BEGIN@189 at line 189 of Tie/Hash.pm
# once (26µs+188µs) by overload::BEGIN@147 at line 147 of overload.pm
# once (22µs+186µs) by File::Find::BEGIN@5 at line 5 of File/Find.pm
# once (23µs+172µs) by constant::BEGIN@4 at line 4 of constant.pm
# once (19µs+169µs) by Class::Struct::BEGIN@8 at line 8 of Class/Struct.pm | ||||
39 | 35 | 175µs | shift; | ||
40 | my @categories = @_; | ||||
41 | |||||
42 | my $package = (caller(0))[0]; | ||||
43 | 7 | 1.29ms | warnings::register_categories($package); # spent 1.29ms making 7 calls to warnings::register_categories, avg 185µs/call | ||
44 | |||||
45 | warnings::register_categories($package . "::$_") for @categories; | ||||
46 | } | ||||
47 | |||||
48 | 1 | 12µs | 1; |