This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
qw(a\\b) must be parsed like 'a\\b', i.e., backslash escapes
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 28 Apr 2000 08:27:12 +0000 (08:27 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Fri, 28 Apr 2000 08:27:12 +0000 (08:27 +0000)
itself and no other (from Tom Hughes)

p4raw-id: //depot/perl@5989

t/op/array.t
toke.c

index 1108f49..97a4a40 100755 (executable)
@@ -139,8 +139,8 @@ t("@foo" eq "bar burbl blah");                                      # 39
 @foo = ('XXX',@foo, 'YYY');
 t("@foo" eq "XXX bar burbl blah YYY");                         # 40
 
-@foo = @foo = qw(foo bar burbl blah);
-t("@foo" eq "foo bar burbl blah");                             # 41
+@foo = @foo = qw(foo b\a\r bu\\rbl blah);
+t("@foo" eq 'foo b\a\r bu\\rbl blah');                         # 41
 
 @bar = @foo = qw(foo bar);                                     # 42
 t("@foo" eq "foo bar");
diff --git a/toke.c b/toke.c
index 7d4e937..5c1b945 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -4504,7 +4504,7 @@ Perl_yylex(pTHX)
                            for (; !isSPACE(*d) && len; --len, ++d) ;
                        }
                        words = append_elem(OP_LIST, words,
-                                           newSVOP(OP_CONST, 0, newSVpvn(b, d-b)));
+                                           newSVOP(OP_CONST, 0, tokeq(newSVpvn(b, d-b))));
                    }
                }
                if (words) {