Commit | Line | Data |
---|---|---|
5ca7f68d | 1 | package warnings::register; |
d3a7d8c7 | 2 | |
f4eedc6b | 3 | our $VERSION = '1.04'; |
5ca7f68d | 4 | require warnings; |
d3a7d8c7 | 5 | |
572bfd36 RS |
6 | # left here as cruft in case other users were using this undocumented routine |
7 | # -- rjbs, 2010-09-08 | |
d3a7d8c7 GS |
8 | sub mkMask |
9 | { | |
5ca7f68d RGS |
10 | my ($bit) = @_; |
11 | my $mask = ""; | |
d3a7d8c7 | 12 | |
5ca7f68d RGS |
13 | vec($mask, $bit, 1) = 1; |
14 | return $mask; | |
d3a7d8c7 GS |
15 | } |
16 | ||
17 | sub import | |
18 | { | |
5ca7f68d | 19 | shift; |
572bfd36 RS |
20 | my @categories = @_; |
21 | ||
5ca7f68d | 22 | my $package = (caller(0))[0]; |
5e7ad92a | 23 | warnings::register_categories($package); |
572bfd36 | 24 | |
5e7ad92a | 25 | warnings::register_categories($package . "::$_") for @categories; |
d3a7d8c7 | 26 | } |
5ca7f68d | 27 | 1; |
f4eedc6b DD |
28 | __END__ |
29 | ||
30 | =pod | |
31 | ||
32 | =head1 NAME | |
33 | ||
34 | warnings::register - warnings import function | |
35 | ||
36 | =head1 SYNOPSIS | |
37 | ||
38 | use warnings::register; | |
39 | ||
40 | =head1 DESCRIPTION | |
41 | ||
42 | Creates a warnings category with the same name as the current package. | |
43 | ||
44 | See L<warnings> for more information on this module's usage. | |
45 | ||
46 | =cut |