$a !=~ m#1#;
$a !=~/1/;
$a !=~ ?/?;
+$a !=~ y/1//;
+$a !=~ tr/1//;
+$a !=~ s/1//;
$a != ~/1/;
no warnings "syntax";
$a !=~ /1/;
$a !=~ m#1#;
$a !=~/1/;
$a !=~ ?/?;
+$a !=~ y/1//;
+$a !=~ tr/1//;
+$a !=~ s/1//;
EXPECT
!=~ should be !~ at - line 4.
!=~ should be !~ at - line 5.
!=~ should be !~ at - line 6.
!=~ should be !~ at - line 7.
+!=~ should be !~ at - line 8.
+!=~ should be !~ at - line 9.
+!=~ should be !~ at - line 10.
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 !~");
}