diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-29 10:18:59 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-29 10:18:59 +0000 |
commit | 4438c4b75b842b6c829a7da9841e97abb875b1d8 (patch) | |
tree | 559b1a700465df1cb1ae02ada9b9c9e48dd9539f /lib | |
parent | 6dd159d1401b9b9973dd00c1235374efbcb27144 (diff) | |
download | perl-4438c4b75b842b6c829a7da9841e97abb875b1d8.tar.gz |
Rename warning to warnings, from Paul Marquess.
p4raw-id: //depot/cfgperl@4038
Diffstat (limited to 'lib')
-rw-r--r-- | lib/warnings.pm (renamed from lib/warning.pm) | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/lib/warning.pm b/lib/warnings.pm index 70ed91e56c..e15d364193 100644 --- a/lib/warning.pm +++ b/lib/warnings.pm @@ -1,21 +1,21 @@ -# This file was created by warning.pl +# This file was created by warnings.pl # Any changes made here will be lost. # -package warning; +package warnings; =head1 NAME -warning - Perl pragma to control optional warnings +warnings - Perl pragma to control optional warnings =head1 SYNOPSIS - use warning; - no warning; + use warnings; + no warnings; - use warning "all"; - no warning "all"; + use warnings "all"; + no warnings "all"; =head1 DESCRIPTION @@ -130,30 +130,12 @@ sub bits { sub import { shift; - $^B |= bits(@_ ? @_ : 'all') ; + ${^Warnings} |= bits(@_ ? @_ : 'all') ; } sub unimport { shift; - $^B &= ~ bits(@_ ? @_ : 'all') ; -} - - -sub make_fatal -{ - my $self = shift ; - my $bitmask = $self->bits(@_) ; - $SIG{__WARN__} = - sub - { - die @_ if $^B & $bitmask ; - warn @_ - } ; -} - -sub bitmask -{ - return $^B ; + ${^Warnings} &= ~ bits(@_ ? @_ : 'all') ; } sub enabled @@ -161,7 +143,7 @@ sub enabled my $string = shift ; return 1 - if $bits{$string} && $^B & $bits{$string} ; + if $bits{$string} && ${^Warnings} & $bits{$string} ; return 0 ; } |