Cross Reference: register.pm
xref
: /
osnet-11
/
usr
/
src
/
cmd
/
perl
/
5.8.4
/
distrib
/
lib
/
warnings
/
register.pm
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
1
N/A
package
warnings
::
register
;
1
N/A
1
N/A
our
$
VERSION
=
'1.00'
;
1
N/A
1
N/A
=pod
1
N/A
1
N/A
=head1 NAME
1
N/A
1
N/A
warnings::register - warnings import function
1
N/A
1
N/A
=head1 SYNOPSIS
1
N/A
1
N/A
use warnings::register ;
1
N/A
1
N/A
=head1 DESCRIPTION
1
N/A
1
N/A
Create a warnings category with the same name as the current package.
1
N/A
1
N/A
See L<
perlmodlib
/
Pragmatic
Modules> and L<perllexwarn>.
1
N/A
1
N/A
1
N/A
=cut
1
N/A
1
N/A
require
warnings
;
1
N/A
1
N/A
sub
mkMask
1
N/A
{
1
N/A
my
($
bit
) = @_ ;
1
N/A
my
$
mask
=
""
;
1
N/A
1
N/A
vec
($
mask
, $
bit
,
1
) =
1
;
1
N/A
return
$
mask
;
1
N/A
}
1
N/A
1
N/A
sub
import
1
N/A
{
1
N/A
shift
;
1
N/A
my
$
package
= (
caller
(
0
))[
0
] ;
1
N/A
if
(!
defined
$
warnings
::
Bits
{$
package
}) {
1
N/A
$
warnings
::
Bits
{$
package
} =
mkMask
($
warnings
::
LAST_BIT
) ;
1
N/A
vec
($
warnings
::
Bits
{
'all'
}, $
warnings
::
LAST_BIT
,
1
) =
1
;
1
N/A
$
warnings
::
Offsets
{$
package
} = $
warnings
::
LAST_BIT
++ ;
1
N/A
foreach
my
$k (
keys
%
warnings
::
Bits
) {
1
N/A
vec
($
warnings
::
Bits
{$k}, $
warnings
::
LAST_BIT
,
1
) =
0
;
1
N/A
}
1
N/A
$
warnings
::
DeadBits
{$
package
} =
mkMask
($
warnings
::
LAST_BIT
);
1
N/A
vec
($
warnings
::
DeadBits
{
'all'
}, $
warnings
::
LAST_BIT
++,
1
) =
1
;
1
N/A
}
1
N/A
}
1
N/A
1
N/A
1
;