summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2015-09-14 14:32:07 +1000
committerTony Cook <tony@develop-help.com>2015-10-12 14:55:52 +1100
commit4a21999a595cf89f78d57aa5b3fdf3fbfa638fb1 (patch)
tree852024f314be6fbf92c411103e12f8cc186698dc
parent3d8ff82557d67bc81d10600b537a57f90f401a4f (diff)
downloadperl-4a21999a595cf89f78d57aa5b3fdf3fbfa638fb1.tar.gz
[perl #126051] make the warnings::enabled example use warnings::enabled
7e6d00f88633 added the warnif() function and changed most uses of warnings:enabled() to use warnif(), including this one. Revert just that part.
-rw-r--r--lib/warnings.pm6
-rw-r--r--regen/warnings.pl6
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm
index ba466a88b9..8d94724610 100644
--- a/lib/warnings.pm
+++ b/lib/warnings.pm
@@ -1015,8 +1015,10 @@ this snippet of code:
package MyMod::Abc;
sub open {
- warnings::warnif("deprecated",
- "open is deprecated, use new instead");
+ if (warnings::enabled("deprecated")) {
+ warnings::warn("deprecated",
+ "open is deprecated, use new instead");
+ }
new(@_);
}
diff --git a/regen/warnings.pl b/regen/warnings.pl
index 6a07493624..18f337e03b 100644
--- a/regen/warnings.pl
+++ b/regen/warnings.pl
@@ -1144,8 +1144,10 @@ this snippet of code:
package MyMod::Abc;
sub open {
- warnings::warnif("deprecated",
- "open is deprecated, use new instead");
+ if (warnings::enabled("deprecated")) {
+ warnings::warn("deprecated",
+ "open is deprecated, use new instead");
+ }
new(@_);
}