| File | /usr/local/lib/perl5/5.8.8/warnings/register.pm |
| Statements Executed | 338 |
| Statement Execution Time | 3.87ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 5 | 5 | 5 | 3.24ms | 3.55ms | warnings::register::import |
| 10 | 2 | 1 | 316µs | 316µs | warnings::register::mkMask |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package warnings::register; | ||||
| 2 | |||||
| 3 | 1 | 7µs | 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 | 280µs | require warnings; | ||
| 25 | |||||
| 26 | sub mkMask | ||||
| 27 | { | ||||
| 28 | 10 | 55µs | my ($bit) = @_; | ||
| 29 | 10 | 50µs | my $mask = ""; | ||
| 30 | |||||
| 31 | 10 | 71µs | vec($mask, $bit, 1) = 1; | ||
| 32 | 10 | 206µs | return $mask; | ||
| 33 | } | ||||
| 34 | |||||
| 35 | sub import | ||||
| 36 | # spent 3.55ms (3.24+316µs) within warnings::register::import which was called 5 times, avg 711µs/call:
# once (721µs+68µs) by Class::DBI::_require_class at line 5 of constant.pm
# once (644µs+63µs) by LWP::Protocol::implementor at line 179 of Socket.pm
# once (643µs+61µs) by IO::Socket::connect at line 10 of IO/Select.pm
# once (635µs+68µs) by base::import at line 131 of overload.pm
# once (594µs+56µs) by vars::BEGIN at line 7 of vars.pm | ||||
| 37 | 5 | 24µs | shift; | ||
| 38 | 5 | 76µs | my $package = (caller(0))[0]; | ||
| 39 | 5 | 118µs | if (! defined $warnings::Bits{$package}) { | ||
| 40 | 5 | 101µs | 5 | 159µs | $warnings::Bits{$package} = mkMask($warnings::LAST_BIT); # spent 159µs making 5 calls to warnings::register::mkMask, avg 32µs/call |
| 41 | 5 | 33µs | vec($warnings::Bits{'all'}, $warnings::LAST_BIT, 1) = 1; | ||
| 42 | 5 | 30µs | $warnings::Offsets{$package} = $warnings::LAST_BIT ++; | ||
| 43 | 5 | 274µs | foreach my $k (keys %warnings::Bits) { | ||
| 44 | 250 | 2.36ms | vec($warnings::Bits{$k}, $warnings::LAST_BIT, 1) = 0; | ||
| 45 | } | ||||
| 46 | 5 | 129µs | 5 | 157µs | $warnings::DeadBits{$package} = mkMask($warnings::LAST_BIT); # spent 157µs making 5 calls to warnings::register::mkMask, avg 31µs/call |
| 47 | 5 | 42µs | vec($warnings::DeadBits{'all'}, $warnings::LAST_BIT++, 1) = 1; | ||
| 48 | } | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | 1 | 9µs | 1; |