This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
perldiag: rewording
[perl5.git]
/
pod
/
perllexwarn.pod
diff --git
a/pod/perllexwarn.pod
b/pod/perllexwarn.pod
index
45a7f5f
..
ab71729
100644
(file)
--- a/
pod/perllexwarn.pod
+++ b/
pod/perllexwarn.pod
@@
-91,7
+91,7
@@
a block of code. You might expect this to be enough to do the trick:
}
When this code is run with the B<-w> flag, a warning will be produced
}
When this code is run with the B<-w> flag, a warning will be produced
-for the C<$a> line
--
C<"Reversed += operator">.
+for the C<$a> line
:
C<"Reversed += operator">.
The problem is that Perl has both compile-time and run-time warnings. To
disable compile-time warnings you need to rewrite the code like this:
The problem is that Perl has both compile-time and run-time warnings. To
disable compile-time warnings you need to rewrite the code like this:
@@
-177,7
+177,7
@@
will work unchanged.
=item 2.
=item 2.
-The B<-w> flag just sets the global C<$^W> variable as in 5.005
-- t
his
+The B<-w> flag just sets the global C<$^W> variable as in 5.005
. T
his
means that any legacy code that currently relies on manipulating C<$^W>
to control warning behavior will still work as is.
means that any legacy code that currently relies on manipulating C<$^W>
to control warning behavior will still work as is.
@@
-520,6
+520,16
@@
a warning.
Notice also that the warning is reported at the line where the object is first
used.
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>.
=head1 SEE ALSO
L<warnings>, L<perldiag>.