From: Rafael Garcia-Suarez Date: Tue, 24 Nov 2009 12:51:21 +0000 (+0100) Subject: Bump version and regenerate warnings.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=789c461534f3eb0346447f8127786b7da3017f6c;p=p5sagit%2Fp5-mst-13.2.git Bump version and regenerate warnings.pm --- diff --git a/lib/warnings.pm b/lib/warnings.pm index 6049437..771c98c 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -6,7 +6,7 @@ package warnings; -our $VERSION = '1.07'; +our $VERSION = '1.08'; # Verify that we're called correctly so that warnings will work. # see also strict.pm. @@ -84,6 +84,27 @@ Return TRUE if that warnings category is enabled in the first scope where the object is used. Otherwise returns FALSE. +=item warnings::fatal_enabled() + +Return TRUE if the warnings category with the same name as the current +package has been set to FATAL in the calling module. +Otherwise returns FALSE. + +=item warnings::fatal_enabled($category) + +Return TRUE if the warnings category C<$category> has been set to FATAL in +the calling module. +Otherwise returns FALSE. + +=item warnings::fatal_enabled($object) + +Use the name of the class for the object reference, C<$object>, as the +warnings category. + +Return TRUE if that warnings category has been set to FATAL in the first +scope where the object is used. +Otherwise returns FALSE. + =item warnings::warn($message) Print C<$message> to STDERR. @@ -469,6 +490,17 @@ sub enabled vec($callers_bitmask, $Offsets{'all'}, 1) ; } +sub fatal_enabled +{ + Croaker("Usage: warnings::fatal_enabled([category])") + unless @_ == 1 || @_ == 0 ; + + my ($callers_bitmask, $offset, $i) = __chk(@_) ; + + return 0 unless defined $callers_bitmask; + return vec($callers_bitmask, $offset + 1, 1) || + vec($callers_bitmask, $Offsets{'all'} + 1, 1) ; +} sub warn { diff --git a/warnings.pl b/warnings.pl index 9d84a79..835fd7c 100644 --- a/warnings.pl +++ b/warnings.pl @@ -451,7 +451,7 @@ __END__ package warnings; -our $VERSION = '1.07'; +our $VERSION = '1.08'; # Verify that we're called correctly so that warnings will work. # see also strict.pm.