void context !~ generates "Useless use of not at line..." warning
Yitzchak Scott-Thoennes [Sun, 9 May 2004 00:59:19 +0000 (17:59 -0700)]
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: