From: Hugo van der Sanden Date: Mon, 21 Oct 2002 11:27:40 +0000 (+0100) Subject: Re: [perl #16184] Unexpected warning when using C<< open FH => >> X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66fbe8fb06e4bc8631604373e6a099f620f92dcf;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #16184] Unexpected warning when using C<< open FH => >> Message-Id: <200210211027.g9LARef05722@crypt.compulink.co.uk> p4raw-id: //depot/perl@18042 --- diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index 0a5346a..ca0dc6e 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -614,6 +614,10 @@ open FOO || time; EXPECT Precedence problem: open FOO should be open(FOO) at - line 2. ######## +# toke.c (and [perl #16184]) +open FOO => "<&0"; close FOO; +EXPECT +######## # toke.c $^W = 0 ; open FOO || time; diff --git a/toke.c b/toke.c index d3bdf39..b4c886f 100644 --- a/toke.c +++ b/toke.c @@ -4648,10 +4648,14 @@ Perl_yylex(pTHX) char *t; for (d = s; isALNUM_lazy_if(d,UTF); d++) ; t = skipspace(d); - if (strchr("|&*+-=!?:.", *t) && ckWARN_d(WARN_PRECEDENCE)) + if (strchr("|&*+-=!?:.", *t) && ckWARN_d(WARN_PRECEDENCE) + /* [perl #16184] */ + && !(t[0] == '=' && t[1] == '>') + ) { Perl_warner(aTHX_ packWARN(WARN_PRECEDENCE), "Precedence problem: open %.*s should be open(%.*s)", - d-s,s, d-s,s); + d - s, s, d - s, s); + } } LOP(OP_OPEN,XTERM);