Change 13490 by jhi@alpha on 2001/12/06 15:08:40

        Subject: [PATCH] Re: weirdness in regexps
        From: Robin Houston <[EMAIL PROTECTED]> 
        Date: Thu, 6 Dec 2001 14:44:01 +0000
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/op.c#459 edit
.... //depot/perl/t/lib/strict/subs#2 edit

Differences ...

==== //depot/perl/op.c#459 (text) ====
Index: perl/op.c
--- perl/op.c.~1~       Thu Dec  6 08:15:05 2001
+++ perl/op.c   Thu Dec  6 08:15:05 2001
@@ -2053,6 +2053,13 @@
              desc, sample, sample);
     }
 
+    if (right->op_type == OP_CONST &&
+       cSVOPx(right)->op_private & OPpCONST_BARE &&
+       cSVOPx(right)->op_private & OPpCONST_STRICT)
+    {
+       no_bareword_allowed(right);
+    }
+
     if (!(right->op_flags & OPf_STACKED) &&
        (right->op_type == OP_MATCH ||
        right->op_type == OP_SUBST ||

==== //depot/perl/t/lib/strict/subs#2 (text) ====
Index: perl/t/lib/strict/subs
--- perl/t/lib/strict/subs.~1~  Thu Dec  6 08:15:05 2001
+++ perl/t/lib/strict/subs      Thu Dec  6 08:15:05 2001
@@ -317,3 +317,11 @@
 Foo B 2
 Foo C 3
 Foo D 4
+########
+
+# Check that barewords on the RHS of a regex match are caught
+use strict;
+"" =~ foo;
+EXPECT
+Bareword "foo" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
End of Patch.

Reply via email to