From f34840d8d697d9f8be532dea1352cc0aeefc696b Mon Sep 17 00:00:00 2001 From: Mark-Jason Dominus Date: Mon, 1 Apr 2002 08:22:01 -0500 Subject: warning for split(/.../g, ...); Message-ID: <20020401182201.21189.qmail@plover.com> p4raw-id: //depot/perl@15663 --- op.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'op.c') diff --git a/op.c b/op.c index 9b07a2ffba..e7f10421cb 100644 --- a/op.c +++ b/op.c @@ -6658,6 +6658,10 @@ Perl_ck_split(pTHX_ OP *o) kid->op_type = OP_PUSHRE; kid->op_ppaddr = PL_ppaddr[OP_PUSHRE]; scalar(kid); + if (ckWARN(WARN_REGEXP) && ((PMOP *)kid)->op_pmflags & PMf_GLOBAL) { + Perl_warner(aTHX_ packWARN(WARN_REGEXP), + "Use of /g modifier is meaningless in split"); + } if (!kid->op_sibling) append_elem(OP_SPLIT, o, newDEFSVOP()); -- cgit v1.2.1