Benchmark notes (from Barrie Slaymaker <barries@slaysys.com>)
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index 357f46d..d257114 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -531,6 +531,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
            else if ((COP*)PL_curcop == &PL_compiling) {
                stash = PL_curstash;
                if (add && (PL_hints & HINT_STRICT_VARS) &&
+                   !(add & GV_ADDOUR) &&
                    sv_type != SVt_PVCV &&
                    sv_type != SVt_PVGV &&
                    sv_type != SVt_PVFM &&
@@ -568,26 +569,15 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     /* By this point we should have a stash and a name */
 
     if (!stash) {
-       if (!add)
-           return Nullgv;
-       {
-           char sv_type_char = ((sv_type == SVt_PV) ? '$'
-                                : (sv_type == SVt_PVAV) ? '@'
-                                : (sv_type == SVt_PVHV) ? '%'
-                                : 0);
-           if (sv_type_char) 
-               Perl_warn(aTHX_ "Global symbol \"%c%s\" requires explicit package name",
-                    sv_type_char, name);
-           else
-               Perl_warn(aTHX_ "Global symbol \"%s\" requires explicit package name",
-                    name);
+       if (add) {
+           qerror(Perl_mess(aTHX_
+                "Global symbol \"%s%s\" requires explicit package name",
+                (sv_type == SVt_PV ? "$"
+                 : sv_type == SVt_PVAV ? "@"
+                 : sv_type == SVt_PVHV ? "%"
+                 : ""), name));
        }
-       ++PL_error_count;
-       stash = PL_curstash ? PL_curstash : PL_defstash;        /* avoid core dumps */
-       add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
-                      : (sv_type == SVt_PVAV) ? GVf_IMPORTED_AV
-                      : (sv_type == SVt_PVHV) ? GVf_IMPORTED_HV
-                      : 0);
+       return Nullgv;
     }
 
     if (!SvREFCNT(stash))      /* symbol table under destruction */
@@ -677,6 +667,10 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
            }
        }
        break;
+    case 'V':
+       if (strEQ(name, "VERSION"))
+           GvMULTI_on(gv);
+       break;
 
     case '&':
        if (len > 1)
@@ -757,7 +751,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     case '/':
     case '|':
     case '\001':
-    case '\002':
     case '\003':
     case '\004':
     case '\005':
@@ -767,7 +760,6 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     case '\017':
     case '\020':
     case '\024':
-    case '\027':
        if (len > 1)
            break;
        goto magicalize;
@@ -775,6 +767,10 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
        if (len > 1)
            break;
        goto ro_magicalize;
+    case '\027':       /* $^W & $^Warnings */
+       if (len > 1 && strNE(name, "\027arnings"))
+           break;
+       goto magicalize;
 
     case '+':
        if (len > 1)