This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
improve registration of warning categories
authorRicardo Signes <rjbs@cpan.org>
Wed, 8 Sep 2010 20:40:26 +0000 (16:40 -0400)
committerRicardo Signes <rjbs@cpan.org>
Fri, 10 Sep 2010 15:06:27 +0000 (11:06 -0400)
commit572bfd364a342a66f375085e1dff02253f3de103
tree7ca1c0e3b11092e921e8f02976913e8ca6106720
parent3167abe51b640d3c3589b1f66145bedb05d9405f
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
lib/warnings.pm
lib/warnings/register.pm
pod/perllexwarn.pod
t/lib/warnings/9enabled