diff options
author | Lukas Mai <l.mai@web.de> | 2015-11-21 00:16:31 +0100 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2015-11-21 00:26:10 +0100 |
commit | 4639a3a7d1d9f85f2e8510b689a8e047b15ed452 (patch) | |
tree | b04364e6c328184657c1bb4a8db4ae14ee6be409 /op.c | |
parent | 7c294235c2f28d1f9762b654787d29331165f8fa (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |