This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
charnames.pm: Nits in pod
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index a003adb..79bc0e9 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1064,9 +1064,10 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
     }
 
     for (name_cursor = name; name_cursor < name_end; name_cursor++) {
-       if ((*name_cursor == ':' && name_cursor < name_em1
+       if (name_cursor < name_em1 &&
+           ((*name_cursor == ':'
             && name_cursor[1] == ':')
-           || (*name_cursor == '\'' && name_cursor[1]))
+           || *name_cursor == '\''))
        {
            if (!stash)
                stash = PL_defstash;
@@ -1290,7 +1291,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
     if (stash != PL_defstash) { /* not the main stash */
        /* We only have to check for four names here: EXPORT, ISA, OVERLOAD
           and VERSION. All the others apply only to the main stash. */
-       if (len > 1) {
+       if (len > 2) {
            const char * const name2 = name + 1;
            switch (*name) {
            case 'E':
@@ -1469,9 +1470,6 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
 #endif
            goto magicalize;
 
-       case '$':               /* $$ */
-           SvREADONLY_on(GvSVn(gv));
-           goto magicalize;
        case '!':               /* $! */
            GvMULTI_on(gv);
            /* If %! has been used, automatically load Errno.pm. */
@@ -1543,6 +1541,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
        case '>':               /* $> */
        case '\\':              /* $\ */
        case '/':               /* $/ */
+       case '$':               /* $$ */
        case '\001':    /* $^A */
        case '\003':    /* $^C */
        case '\004':    /* $^D */