This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta entries for op_class() and op_dump()
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 2570cf0..ae800c9 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1217,7 +1217,8 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
     )
        Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
                         "Use of inherited AUTOLOAD for non-method %" SVf
-                        "::%" UTF8f "() is deprecated",
+                        "::%" UTF8f "() is deprecated. This will be "
+                         "fatal in Perl 5.28",
                         SVfARG(packname),
                          UTF8fARG(is_utf8, len, name));
 
@@ -1662,8 +1663,15 @@ S_parse_gv_stash_name(pTHX_ HV **stash, GV **gv, const char **name,
                 name_cursor++;
             *name = name_cursor+1;
             if (*name == name_end) {
-                if (!*gv)
-                    *gv = MUTABLE_GV(*hv_fetchs(PL_defstash, "main::", TRUE));
+                if (!*gv) {
+                   *gv = MUTABLE_GV(*hv_fetchs(PL_defstash, "main::", TRUE));
+                   if (SvTYPE(*gv) != SVt_PVGV) {
+                       gv_init_pvn(*gv, PL_defstash, "main::", 6,
+                                   GV_ADDMULTI);
+                       GvHV(*gv) =
+                           MUTABLE_HV(SvREFCNT_inc_simple(PL_defstash));
+                   }
+               }
                 return TRUE;
             }
         }
@@ -2156,9 +2164,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
        case '*':               /* $* */
        case '#':               /* $# */
            if (sv_type == SVt_PV)
-               /* diag_listed_as: $* is no longer supported */
+               /* diag_listed_as: $* is no longer supported. Its use will be fatal in Perl 5.30 */
                Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX),
-                                "$%c is no longer supported", *name);
+                                "$%c is no longer supported. Its use "
+                                 "will be fatal in Perl 5.30", *name);
            break;
        case '\010':    /* $^H */
            {
@@ -2268,10 +2277,11 @@ S_maybe_multimagic_gv(pTHX_ GV *gv, const char *name, const svtype sv_type)
             require_tie_mod_s(gv, *name, "Tie::Hash::NamedCapture", 0);
     } else if (sv_type == SVt_PV) {
         if (*name == '*' || *name == '#') {
-            /* diag_listed_as: $* is no longer supported */
+            /* diag_listed_as: $# is no longer supported. Its use will be fatal in Perl 5.30 */
             Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED,
                                              WARN_SYNTAX),
-                             "$%c is no longer supported", *name);
+                             "$%c is no longer supported. Its use "
+                             "will be fatal in Perl 5.30", *name);
         }
     }
     if (sv_type==SVt_PV || sv_type==SVt_PVGV) {