File | /opt/wise/lib/perl5/5.10.0/warnings/register.pm | Statements Executed | 333 | Total Time | 0.000629000000000003 seconds |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine | |
---|---|---|---|---|---|---|
5 | 5 | 5 | 0.00055 | 0.00067 | warnings::register:: | import |
10 | 2 | 1 | 0.00011 | 0.00011 | warnings::register:: | mkMask |
Line | Stmts. | Exclusive Time | Avg. | Code |
---|---|---|---|---|
1 | package warnings::register; | |||
2 | ||||
3 | 1 | 1.0e-6 | 1.0e-6 | our $VERSION = '1.01'; |
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 | 0 | 0 | require warnings; |
25 | ||||
26 | sub mkMask | |||
27 | { | |||
28 | 40 | 5.8e-5 | 1.4e-6 | my ($bit) = @_; |
29 | my $mask = ""; | |||
30 | ||||
31 | vec($mask, $bit, 1) = 1; | |||
32 | return $mask; | |||
33 | } | |||
34 | ||||
35 | sub import | |||
36 | # spent 666µs (555+111) within warnings::register::import which was called 5 times, avg 133µs/call:
# once (153µs+23µs) by overload::BEGIN at line 138 of /opt/wise/lib/perl5/5.10.0/overload.pm
# once (117µs+27µs) at line 5 of /opt/wise/lib/perl5/5.10.0/File/Find.pm
# once (104µs+16µs) by Tie::Hash::BEGIN at line 189 of /opt/wise/lib/perl5/5.10.0/Tie/Hash.pm
# once (87µs+30µs) at line 7 of /opt/wise/lib/perl5/5.10.0/vars.pm
# once (94µs+15µs) at line 4 of /opt/wise/lib/perl5/5.10.0/constant.pm | |||
37 | 290 | 0.00056 | 1.9e-6 | shift; |
38 | my $package = (caller(0))[0]; | |||
39 | if (! defined $warnings::Bits{$package}) { | |||
40 | $warnings::Bits{$package} = mkMask($warnings::LAST_BIT); # spent 54µs making 5 calls to warnings::register::mkMask, avg 11µs/call | |||
41 | vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1; | |||
42 | $warnings::Offsets{$package} = $warnings::LAST_BIT ++; | |||
43 | foreach my $k (keys %warnings::Bits) { | |||
44 | vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0; | |||
45 | } | |||
46 | $warnings::DeadBits{$package} = mkMask($warnings::LAST_BIT); # spent 57µs making 5 calls to warnings::register::mkMask, avg 11µs/call | |||
47 | vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1; | |||
48 | } | |||
49 | } | |||
50 | ||||
51 | 1 | 6.0e-6 | 6.0e-6 | 1; |