summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2010-09-08 16:40:26 -0400
committerRicardo Signes <rjbs@cpan.org>2010-09-10 11:06:27 -0400
commit572bfd364a342a66f375085e1dff02253f3de103 (patch)
tree7ca1c0e3b11092e921e8f02976913e8ca6106720 /pod
parent3167abe51b640d3c3589b1f66145bedb05d9405f (diff)
downloadperl-572bfd364a342a66f375085e1dff02253f3de103.tar.gz
improve registration of warning categories
1. &warnings::register is added as the public mechanism for adding new warning categories, rather than warnings::register::import knowing about warnings's internals 2. warnings::register::import is updated to use &warnings::register 3. warnings::register::import can take a list of subcategories The upshot is that you can now write: package MyTool; use warnings::register qw(io typos); warnings::warnif('MyTool::io', $message); ...and tools that register new warnings categories do not need to cargo cult code from warnings/register.pm
Diffstat (limited to 'pod')
-rw-r--r--pod/perllexwarn.pod10
1 files changed, 10 insertions, 0 deletions
diff --git a/pod/perllexwarn.pod b/pod/perllexwarn.pod
index 835914e486..ab717291cb 100644
--- a/pod/perllexwarn.pod
+++ b/pod/perllexwarn.pod
@@ -520,6 +520,16 @@ a warning.
Notice also that the warning is reported at the line where the object is first
used.
+When registering new categories of warning, you can supply more names to
+warnings::register like this:
+
+ package MyModule;
+ use warnings::register qw(format precision);
+
+ ...
+
+ warnings::warnif('MyModule::format', '...');
+
=head1 SEE ALSO
L<warnings>, L<perldiag>.