From: Jeff Pinyan Date: Sat, 3 Mar 2001 17:14:07 +0000 (-0500) Subject: pattern in G_ARRAY context X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db615365202f390b6c9c07819116dcb70ebcf654;p=p5sagit%2Fp5-mst-13.2.git pattern in G_ARRAY context Message-ID: p4raw-id: //depot/perl@9018 --- diff --git a/pp_hot.c b/pp_hot.c index 51229bb..711b560 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1249,7 +1249,7 @@ PP(pp_match) } } } - if ((gimme != G_ARRAY && !global && rx->nparens) + if ((!global && rx->nparens) || SvTEMP(TARG) || PL_sawampersand) r_flags |= REXEC_COPY_STR; if (SvSCREAM(TARG)) diff --git a/t/op/pat.t b/t/op/pat.t index 237ea44..3a4623d 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4,7 +4,7 @@ # the format supported by op/regexp.t. If you want to add a test # that does fit that format, add it to op/re_tests, not here. -print "1..242\n"; +print "1..243\n"; BEGIN { chdir 't' if -d 't'; @@ -1203,3 +1203,10 @@ print "ok 241\n"; print "not " unless tr/\x89-\x91//d == 1; print "ok 242\n"; +{ + # japhy -- added 03/03/2001 + () = (my $str = "abc") =~ /(...)/; + $str = "def"; + print "not " if $1 ne "abc"; + print "ok 243\n"; +}