summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorLukas Mai <l.mai@web.de>2015-11-21 00:16:31 +0100
committerLukas Mai <l.mai@web.de>2015-11-21 00:26:10 +0100
commit4639a3a7d1d9f85f2e8510b689a8e047b15ed452 (patch)
treeb04364e6c328184657c1bb4a8db4ae14ee6be409 /op.c
parent7c294235c2f28d1f9762b654787d29331165f8fa (diff)
downloadperl-4639a3a7d1d9f85f2e8510b689a8e047b15ed452.tar.gz
[perl #124280] don't warn for 'my $foo, *bar'
It doesn't make sense to warn 'Parentheses missing around "my" list' if adding the parens causes a syntax error (you can't declare typeglobs). But it does make sense to warn for 'local $foo, *bar' because typeglobs can be localized. Thus modify the heuristic to only warn for '*' if we're not lexically declaring something.
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index 91a1b806d2..37d8656431 100644
--- a/op.c
+++ b/op.c
@@ -4154,7 +4154,8 @@ Perl_localize(pTHX_ OP *o, I32 lex)
s++;
while (1) {
- if (*s && strchr("@$%*", *s) && *++s
+ if (*s && (strchr("@$%", *s) || (!lex && *s == '*'))
+ && *++s
&& (isWORDCHAR(*s) || UTF8_IS_CONTINUED(*s))) {
s++;
sigil = TRUE;