d_getservbyname_r undef up to at least OpenBSD 3.5
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index 46aa3aa..e8c1073 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1220,7 +1220,7 @@ S_scan_const(pTHX_ char *start)
 
     const char *leaveit =      /* set of acceptably-backslashed characters */
        PL_lex_inpat
-           ? "\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfeaxcz0123456789[{]} \t\n\r\f\v#"
+           ? "\\.^$@AGZdDwWsSbBpPXC+*?|()-nrtfeaxz0123456789[{]} \t\n\r\f\v#"
            : "";
 
     if (PL_lex_inwhat == OP_TRANS && PL_sublex_info.sub_op) {
@@ -3383,14 +3383,18 @@ Perl_yylex(pTHX)
        s++;
        tmp = *s++;
        if (tmp == '=') {
-            /* was this !=~ where !~ was meant? */
+            /* was this !=~ where !~ was meant?
+             * warn on m:!=~\s+([/?]|[msy]\W|tr\W): */
+
             if (*s == '~' && ckWARN(WARN_SYNTAX)) {
                 char *t = s+1;
 
                 while (t < PL_bufend && isSPACE(*t))
                     ++t;
 
-                if (*t == '/' || (*t == 'm' && !isALNUM(t[1])) || *t == '?')
+                if (*t == '/' || *t == '?' ||
+                    ((*t == 'm' || *t == 's' || *t == 'y') && !isALNUM(t[1])) ||
+                    (*t == 't' && t[1] == 'r' && !isALNUM(t[2])))
                     Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                                 "!=~ should be !~");
             }