From: Rafael Garcia-Suarez Date: Sun, 5 Oct 2003 21:27:54 +0000 (+0200) Subject: Re: [perl #24076] "<> err EXPR" and warnings. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59e104686f63e092d9adf15809bead3d2855af57;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #24076] "<> err EXPR" and warnings. Message-Id: <20031005212754.5ef54472.rgarciasuarez@free.fr> (Applied with tweaks to op.c and a comment.) p4raw-id: //depot/perl@21406 --- diff --git a/op.c b/op.c index a69b515..1aecdaf 100644 --- a/op.c +++ b/op.c @@ -3351,7 +3351,9 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) return first; } } - else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS)) { + else if (ckWARN(WARN_MISC) && (first->op_flags & OPf_KIDS) && + type != OP_DOR) /* [#24076] Don't warn for err FOO. */ + { OP *k1 = ((UNOP*)first)->op_first; OP *k2 = k1->op_sibling; OPCODE warnop = 0; diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 35779a9..e06d251 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -674,6 +674,18 @@ EXPECT Value of readdir() operator can be "0"; test with defined() at - line 4. ######## # op.c +use warnings 'misc'; +open FH, " err $_ = 1; +($_ = ) // ($_ = 1); +opendir DH, "."; +$_ = readdir DH err $_ = 1; +$_ = <*> err $_ = 1; +%a = (1,2,3,4) ; +$_ = each %a err $_ = 1; +EXPECT +######## +# op.c use warnings 'redefine' ; sub fred {} sub fred {}