From: Rafael Garcia-Suarez Date: Sun, 20 Jan 2002 22:53:56 +0000 (+0100) Subject: Re: [PATCH warnings, perldiag] document diagnostics X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d1a39c8be0d615d52d784b13d1b1dd635567f2a;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH warnings, perldiag] document diagnostics Message-ID: <20020120225356.A12093@rafael> p4raw-id: //depot/perl@14365 --- diff --git a/lib/warnings.pm b/lib/warnings.pm index 6b46e35..e579a27 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -291,7 +291,7 @@ sub bits { $mask |= $DeadBits{$word} if $fatal ; } else - { croak("unknown warnings category '$word'")} + { croak("Unknown warnings category '$word'")} } return $mask ; @@ -328,12 +328,12 @@ sub __chk $category = shift ; if (ref $category) { croak ("not an object") - if $category !~ /^([^=]+)=/ ;+ + if $category !~ /^([^=]+)=/ ; $category = $1 ; $isobj = 1 ; } $offset = $Offsets{$category}; - croak("unknown warnings category '$category'") + croak("Unknown warnings category '$category'") unless defined $offset; } else { diff --git a/pod/perldiag.pod b/pod/perldiag.pod index c612b9b..7ea6e85 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -3671,6 +3671,15 @@ iterating over it, and someone else stuck a message in the stream of data Perl expected. Someone's very confused, or perhaps trying to subvert Perl's population of %ENV for nefarious purposes. +=item Unknown warnings category '%s' + +(F) An error issued by the C pragma. You specified a warnings +category that is unknown to perl at this point. + +Note that if you want to enable a warnings category registered by a module +(e.g. C), you must have imported this module +first. + =item unmatched [ in regex; marked by <-- HERE in m/%s/ (F) The brackets around a character class must match. If you wish to diff --git a/t/lib/warnings/2use b/t/lib/warnings/2use index e25d43a..b700ef7 100644 --- a/t/lib/warnings/2use +++ b/t/lib/warnings/2use @@ -8,7 +8,7 @@ __END__ # check illegal category is caught use warnings 'this-should-never-be-a-warning-category' ; EXPECT -unknown warnings category 'this-should-never-be-a-warning-category' at - line 3 +Unknown warnings category 'this-should-never-be-a-warning-category' at - line 3 BEGIN failed--compilation aborted at - line 3. ######## diff --git a/t/lib/warnings/9enabled b/t/lib/warnings/9enabled index c3f2e39..fdce8cd 100755 --- a/t/lib/warnings/9enabled +++ b/t/lib/warnings/9enabled @@ -332,7 +332,7 @@ eval { warnings::warn("fred", "joe") } ; print $@ ; EXPECT Usage: warnings::warn([category,] 'message') at - line 4 -unknown warnings category 'fred' at - line 6 +Unknown warnings category 'fred' at - line 6 ######## # check warnings::warnif @@ -343,7 +343,7 @@ eval { warnings::warnif("fred", "joe") } ; print $@ ; EXPECT Usage: warnings::warnif([category,] 'message') at - line 4 -unknown warnings category 'fred' at - line 6 +Unknown warnings category 'fred' at - line 6 ######## --FILE-- abc.pm diff --git a/warnings.pl b/warnings.pl index e317b0a..e5ac703 100644 --- a/warnings.pl +++ b/warnings.pl @@ -486,7 +486,7 @@ sub bits { $mask |= $DeadBits{$word} if $fatal ; } else - { croak("unknown warnings category '$word'")} + { croak("Unknown warnings category '$word'")} } return $mask ; @@ -523,12 +523,12 @@ sub __chk $category = shift ; if (ref $category) { croak ("not an object") - if $category !~ /^([^=]+)=/ ;+ + if $category !~ /^([^=]+)=/ ; $category = $1 ; $isobj = 1 ; } $offset = $Offsets{$category}; - croak("unknown warnings category '$category'") + croak("Unknown warnings category '$category'") unless defined $offset; } else {