per Larry's idea, parse 1.2.3 as v1.2.3; C<require 5.6.0> and
[p5sagit/p5-mst-13.2.git] / gv.c
diff --git a/gv.c b/gv.c
index 854a822..317cbb0 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1,6 +1,6 @@
 /*    gv.c
  *
- *    Copyright (c) 1991-1999, Larry Wall
+ *    Copyright (c) 1991-2000, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -299,7 +299,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level)
 /*
 =for apidoc gv_fetchmethod
 
-See L<gv_fetchmethod_autoload.
+See L<gv_fetchmethod_autoload>.
 
 =cut
 */
@@ -581,9 +581,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     /* No stash in name, so see how we can default */
 
     if (!stash) {
-       if (isIDFIRST(*name)
-           || (IN_UTF8 && ((*name & 0xc0) == 0xc0) && isIDFIRST_utf8((U8*)name)))
-       {
+       if (isIDFIRST_lazy(name)) {
            bool global = FALSE;
 
            if (isUPPER(*name)) {
@@ -829,25 +827,26 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
     case '\\':
     case '/':
     case '|':
-    case '\001':
-    case '\003':
-    case '\004':
-    case '\005':
-    case '\006':
-    case '\010':
-    case '\011':       /* NOT \t in EBCDIC */
-    case '\017':
-    case '\020':
-    case '\024':
+    case '\001':       /* $^A */
+    case '\003':       /* $^C */
+    case '\004':       /* $^D */
+    case '\005':       /* $^E */
+    case '\006':       /* $^F */
+    case '\010':       /* $^H */
+    case '\011':       /* $^I, NOT \t in EBCDIC */
+    case '\017':       /* $^O */
+    case '\020':       /* $^P */
+    case '\024':       /* $^T */
        if (len > 1)
            break;
        goto magicalize;
-    case '\023':
+    case '\023':       /* $^S */
        if (len > 1)
            break;
        goto ro_magicalize;
-    case '\027':       /* $^W & $^Warnings */
-       if (len > 1 && strNE(name, "\027arnings"))
+    case '\027':       /* $^W & $^WARNING_BITS */
+       if (len > 1 && strNE(name, "\027ARNING_BITS")
+           && strNE(name, "\027IDE_SYSTEM_CALLS"))
            break;
        goto magicalize;
 
@@ -874,7 +873,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
        sv_magic(GvSV(gv), (SV*)gv, 0, name, len);
        break;
 
-    case '\014':
+    case '\014':       /* $^L */
        if (len > 1)
            break;
        sv_setpv(GvSV(gv),"\f");
@@ -895,6 +894,13 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
            SvREADONLY_on(sv);
        }
        break;
+    case '\026':       /* $^V */
+       if (len == 1) {
+           SV *sv = GvSV(gv);
+           GvSV(gv) = SvREFCNT_inc(PL_patchlevel);
+           SvREFCNT_dec(sv);
+       }
+       break;
     }
     return gv;
 }