From fbdd83da9d18c8503ae64943ae75be034fecb787 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= Date: Mon, 16 Apr 2012 01:05:52 +0100 Subject: [PATCH] Don't warn about "ambiguous without parens" for ctrl-glob This fixes the following bogus warning [perl #112456]: $ perl -e 'undef *^H' Warning: Use of "undef" without parentheses is ambiguous at -e line 1. Compare to the non-warning variant: $ perl -e 'undef *{^H}' --- t/lib/warnings/toke | 2 ++ toke.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index dd8dc3d..a9106fb 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -662,6 +662,8 @@ yelp at foo line 30. ######## # toke.c my $a = rand + 4 ; +$a = rand *^H ; +$a = rand $^H ; EXPECT Warning: Use of "rand" without parentheses is ambiguous at - line 2. ######## diff --git a/toke.c b/toke.c index 1d18550..6cc0336 100644 --- a/toke.c +++ b/toke.c @@ -8892,8 +8892,6 @@ S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRL bracket = s; s++; } - else if (ck_uni) - check_uni(); if (s < send) { if (UTF) { const STRLEN skip = UTF8SKIP(s); @@ -8911,6 +8909,8 @@ S_scan_ident(pTHX_ register char *s, register const char *send, char *dest, STRL *d = toCTRL(*s); s++; } + else if (ck_uni && !bracket) + check_uni(); if (bracket) { if (isSPACE(s[-1])) { while (s < send) { -- 2.7.4