summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2022-12-06 14:41:23 +1100
committerTony Cook <tony@develop-help.com>2023-02-07 10:37:30 +1100
commita36fec492e3c37aae28f47766892f34b74d51b31 (patch)
tree3c4da954fc1878fe7d0458dd20a5a4fca79a92cc
parent85fcefb858d7287b1c90277ead7d1cdd170e48d0 (diff)
downloadperl-a36fec492e3c37aae28f47766892f34b74d51b31.tar.gz
Enable the current "Old package separator used in string" by default
If we're going to be removing this entirely, the behavior of existing code is going to change. Make sure everyone sees it.
-rw-r--r--t/lib/warnings/toke15
-rw-r--r--toke.c2
2 files changed, 13 insertions, 4 deletions
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index c03a85299b..e62a9f6273 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -408,21 +408,30 @@ sort ("")
EXPECT
########
-use warnings 'syntax';
@foo::bar = 1..3;
() = "$foo'bar";
() = "@foo'bar";
() = "$#foo'bar";
+use warnings 'syntax';
+() = "$foo'bar";
+() = "@foo'bar";
+() = "$#foo'bar";
no warnings 'syntax' ;
() = "$foo'bar";
() = "@foo'bar";
() = "$#foo'bar";
EXPECT
-Old package separator used in string at - line 3.
+Old package separator used in string at - line 2.
(Did you mean "$foo\'bar" instead?)
+Old package separator used in string at - line 3.
+ (Did you mean "@foo\'bar" instead?)
Old package separator used in string at - line 4.
+ (Did you mean "$#foo\'bar" instead?)
+Old package separator used in string at - line 6.
+ (Did you mean "$foo\'bar" instead?)
+Old package separator used in string at - line 7.
(Did you mean "@foo\'bar" instead?)
-Old package separator used in string at - line 5.
+Old package separator used in string at - line 8.
(Did you mean "$#foo\'bar" instead?)
########
use warnings 'syntax'; use utf8;
diff --git a/toke.c b/toke.c
index ffb9201147..afe245bf7e 100644
--- a/toke.c
+++ b/toke.c
@@ -10157,7 +10157,7 @@ S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
break;
}
if (UNLIKELY(tick_warn && saw_tick && PL_lex_state == LEX_INTERPNORMAL
- && !PL_lex_brackets && ckWARN(WARN_SYNTAX))) {
+ && !PL_lex_brackets && ckWARN_d(WARN_SYNTAX))) {
char *this_d;
char *d2;
Newx(this_d, *s - olds + saw_tick + 2, char); /* +2 for $# */