Filename | C:/tmp64ng/perl/lib/warnings/register.pm |
Statements | Executed 28 statements in 0s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
5 | 5 | 5 | 0s | 0s | 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 | 0s | our $VERSION = '1.03'; | ||
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> for more information on this module's usage. | ||||
20 | |||||
21 | =cut | ||||
22 | |||||
23 | 1 | 0s | require warnings; | ||
24 | |||||
25 | # left here as cruft in case other users were using this undocumented routine | ||||
26 | # -- rjbs, 2010-09-08 | ||||
27 | sub mkMask | ||||
28 | { | ||||
29 | my ($bit) = @_; | ||||
30 | my $mask = ""; | ||||
31 | |||||
32 | vec($mask, $bit, 1) = 1; | ||||
33 | return $mask; | ||||
34 | } | ||||
35 | |||||
36 | sub import | ||||
37 | # spent 0s within warnings::register::import which was called 5 times, avg 0s/call:
# once (0s+0s) by vars::BEGIN@7 at line 7 of vars.pm
# once (0s+0s) by version::BEGIN@6 at line 6 of version.pm
# once (0s+0s) by File::Find::BEGIN@5 at line 5 of File/Find.pm
# once (0s+0s) by overload::BEGIN@144 at line 144 of overload.pm
# once (0s+0s) by constant::BEGIN@4 at line 4 of constant.pm | ||||
38 | 5 | 0s | shift; | ||
39 | 5 | 0s | my @categories = @_; | ||
40 | |||||
41 | 5 | 0s | my $package = (caller(0))[0]; | ||
42 | 5 | 0s | 5 | 0s | warnings::register_categories($package); # spent 0s making 5 calls to warnings::register_categories, avg 0s/call |
43 | |||||
44 | 5 | 0s | warnings::register_categories($package . "::$_") for @categories; | ||
45 | } | ||||
46 | |||||
47 | 1 | 0s | 1; |