Message-ID: <
20040319062035.GA3768@efn.org>
with an improvement suggested by Ton Hospel.
p4raw-id: //depot/perl@22542
(F) You don't have System V shared memory IPC on your system.
+=item !=~ should be !~
+
+(W syntax) The non-matching operator is !~, not !=~. !=~ will be
+interpreted as the != (numeric not equal) and ~ (1's complement)
+operators: probably not what you intended.
+
=item <> should be quotes
(F) You wrote C<< require <file> >> when you should have written
EXPECT
Number found where operator expected at (eval 1) line 1, near "5 6"
(Missing operator before 6?)
-
+########
+# toke.c
+use warnings "syntax";
+$_ = $a = 1;
+$a !=~ /1/;
+$a !=~ m#1#;
+$a !=~/1/;
+$a !=~ ?/?;
+$a != ~/1/;
+no warnings "syntax";
+$a !=~ /1/;
+$a !=~ m#1#;
+$a !=~/1/;
+$a !=~ ?/?;
+EXPECT
+!=~ should be !~ at - line 4.
+!=~ should be !~ at - line 5.
+!=~ should be !~ at - line 6.
+!=~ should be !~ at - line 7.
case '!':
s++;
tmp = *s++;
- if (tmp == '=')
+ if (tmp == '=') {
+ /* was this !=~ where !~ was meant? */
+ if (*s == '~' && ckWARN(WARN_SYNTAX)) {
+ char *t = s+1;
+
+ while (t < PL_bufend && isSPACE(*t))
+ ++t;
+
+ if (*t == '/' || (*t == 'm' && !isALNUM(t[1])) || *t == '?')
+ Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
+ "!=~ should be !~");
+ }
Eop(OP_NE);
+ }
if (tmp == '~')
PMop(OP_NOT);
s--;