This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Correct stupidities in 4c3ac4b
[perl5.git] / pp_hot.c
index 3d46287..06b837b 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -501,10 +501,13 @@ PP(pp_add)
     svl = TOPm1s;
 
     useleft = USE_LEFT(svl);
-    if(useleft && svr == svl) {
+    if(useleft && svr == svl && SvGMAGICAL(svl)) {
        /* Print the uninitialized warning now, so it includes the vari-
           able name. */
-       if (!SvOK(svl)) report_uninit(svl), useleft = 0;
+       if (!SvOK(svl)) {
+           if (ckWARN(WARN_UNINITIALIZED)) report_uninit(svl);
+           useleft = 0;
+       }
        /* Non-magical sv_mortalcopy */
        svl = sv_newmortal();
        sv_setsv_flags(svl, svr, 0);