This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #126593] make sure utf8_heavy.pl doesn't depend on itself
[perl5.git] / lib / warnings.pm
index 1084723..8d94724 100644 (file)
@@ -5,7 +5,7 @@
 
 package warnings;
 
-our $VERSION = '1.34';
+our $VERSION = "1.35";
 
 # Verify that we're called correctly so that warnings will work.
 # see also strict.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(@_);
     }