summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorMark-Jason Dominus <mjd@plover.com>2002-04-01 08:22:01 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-01 17:56:27 +0000
commitf34840d8d697d9f8be532dea1352cc0aeefc696b (patch)
treeb4c94b880655adcbe36cfa7ce857f896f3c13831 /op.c
parente6763d176db5d14f6f7be1cd3c07c1d13323c7ec (diff)
downloadperl-f34840d8d697d9f8be532dea1352cc0aeefc696b.tar.gz
warning for split(/.../g, ...);
Message-ID: <20020401182201.21189.qmail@plover.com> p4raw-id: //depot/perl@15663
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 4 insertions, 0 deletions
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());