From 8f580fb8c3adcd8061f0e72f718bbf4ff930d697 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Fri, 27 Nov 1998 20:51:56 -0500 Subject: Change $#+ Message-Id: <199811280651.BAA18095@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2373 --- mg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mg.c') diff --git a/mg.c b/mg.c index e960c9354a..ba90227a70 100644 --- a/mg.c +++ b/mg.c @@ -326,8 +326,13 @@ magic_regdata_cnt(SV *sv, MAGIC *mg) register REGEXP *rx; char *t; - if (PL_curpm && (rx = PL_curpm->op_pmregexp)) - return rx->lastparen; + if (PL_curpm && (rx = PL_curpm->op_pmregexp)) { + if (mg->mg_obj) /* @+ */ + return rx->nparens; + else /* @- */ + return rx->lastparen; + } + return (U32)-1; } -- cgit v1.2.1