This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
void context !~ generates "Useless use of not at line..." warning
authorYitzchak Scott-Thoennes <sthoenna@efn.org>
Sun, 9 May 2004 00:59:19 +0000 (17:59 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 11 May 2004 09:16:56 +0000 (09:16 +0000)
Message-ID: <20040509075919.GA3752@efn.org>

p4raw-id: //depot/perl@22807

op.c

diff --git a/op.c b/op.c
index b3b5c44..bdc3426 100644 (file)
--- a/op.c
+++ b/op.c
@@ -661,6 +661,15 @@ Perl_scalarvoid(pTHX_ OP *o)
            useless = OP_DESC(o);
        break;
 
+    case OP_NOT:
+       kid = cUNOPo->op_first;
+       if (kid->op_type != OP_MATCH && kid->op_type != OP_SUBST &&
+           kid->op_type != OP_TRANS) {
+               goto func_ops;
+       }
+       useless = "negative pattern binding (!~)";
+       break;
+
     case OP_RV2GV:
     case OP_RV2SV:
     case OP_RV2AV: