diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-12-07 21:45:08 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-12-07 21:45:08 +0000 |
commit | 0ca4541c317eb395329cac582e39db540241d553 (patch) | |
tree | 076350ff7eabc839d57a05b1665f3fb0885568d6 /lib/warnings.pm | |
parent | 766a733e849204725c27391cf2992d649af4aba6 (diff) | |
download | perl-0ca4541c317eb395329cac582e39db540241d553.tar.gz |
Various oddities p4 diff -se showed up
Remove 'our' from warnings.pl
p4raw-id: //depot/perlio@8026
Diffstat (limited to 'lib/warnings.pm')
-rw-r--r-- | lib/warnings.pm | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm index 2517239365..e3416419fd 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -5,6 +5,8 @@ package warnings; +our $VERSION = '1.00'; + =head1 NAME warnings - Perl pragma to control optional warnings @@ -39,7 +41,7 @@ warnings - Perl pragma to control optional warnings If no import list is supplied, all possible warnings are either enabled or disabled. -A number of functions are provided to assist module authors. +A number of functions are provided to assist module authors. =over 4 @@ -295,7 +297,7 @@ sub bits { $mask |= $DeadBits{$word} if $fatal ; } else - { croak("unknown warnings category '$word'")} + { croak("unknown warnings category '$word'")} } return $mask ; @@ -341,13 +343,13 @@ sub __chk unless defined $offset; } else { - $category = (caller(1))[0] ; + $category = (caller(1))[0] ; $offset = $Offsets{$category}; croak("package '$category' not registered for warnings") unless defined $offset ; } - my $this_pkg = (caller(1))[0] ; + my $this_pkg = (caller(1))[0] ; my $i = 2 ; my $pkg ; @@ -361,11 +363,11 @@ sub __chk for ($i = 2 ; $pkg = (caller($i))[0] ; ++ $i) { last if $pkg ne $this_pkg ; } - $i = 2 + $i = 2 if !$pkg || $pkg eq $this_pkg ; } - my $callers_bitmask = (caller($i))[9] ; + my $callers_bitmask = (caller($i))[9] ; return ($callers_bitmask, $offset, $i) ; } @@ -390,7 +392,7 @@ sub warn my $message = pop ; my ($callers_bitmask, $offset, $i) = __chk(@_) ; local $Carp::CarpLevel = $i ; - croak($message) + croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; carp($message) ; @@ -405,12 +407,12 @@ sub warnif my ($callers_bitmask, $offset, $i) = __chk(@_) ; local $Carp::CarpLevel = $i ; - return + return unless defined $callers_bitmask && (vec($callers_bitmask, $offset, 1) || vec($callers_bitmask, $Offsets{'all'}, 1)) ; - croak($message) + croak($message) if vec($callers_bitmask, $offset+1, 1) || vec($callers_bitmask, $Offsets{'all'}+1, 1) ; |