Change 14371 by jhi@alpha on 2002/01/21 19:36:04
Subject: [BUG] /\_/ an unrecognized escape?
From: Michael G Schwern <[EMAIL PROTECTED]>
Date: Mon, 21 Jan 2002 15:22:54 -0500
Message-ID: <20020121202254.GA6731@blackrider>
Affected files ...
.... //depot/perl/t/lib/warnings/toke#6 edit
.... //depot/perl/toke.c#412 edit
Differences ...
==== //depot/perl/t/lib/warnings/toke#6 (text) ====
Index: perl/t/lib/warnings/toke
--- perl/t/lib/warnings/toke.~1~ Mon Jan 21 12:45:05 2002
+++ perl/t/lib/warnings/toke Mon Jan 21 12:45:05 2002
@@ -727,3 +727,14 @@
"@mjd_previously_unused_array";
EXPECT
Possible unintended interpolation of @mjd_previously_unused_array in string at - line
3.
+########
+# toke.c
+# The \q should warn, the \_ should NOT warn.
+use warnings 'misc';
+"foo" =~ /\q/;
+"bar" =~ /\_/;
+no warnings 'misc';
+"foo" =~ /\q/;
+"bar" =~ /\_/;
+EXPECT
+Unrecognized escape \q passed through at - line 4.
==== //depot/perl/toke.c#412 (text) ====
Index: perl/toke.c
--- perl/toke.c.~1~ Mon Jan 21 12:45:05 2002
+++ perl/toke.c Mon Jan 21 12:45:05 2002
@@ -1424,7 +1424,9 @@
/* FALL THROUGH */
default:
{
- if (ckWARN(WARN_MISC) && isALNUM(*s))
+ if (ckWARN(WARN_MISC) &&
+ isALNUM(*s) &&
+ *s != '_')
Perl_warner(aTHX_ WARN_MISC,
"Unrecognized escape \\%c passed through",
*s);
End of Patch.