From db615365202f390b6c9c07819116dcb70ebcf654 Mon Sep 17 00:00:00 2001 From: Jeff Pinyan Date: Sat, 3 Mar 2001 12:14:07 -0500 Subject: pattern in G_ARRAY context Message-ID: p4raw-id: //depot/perl@9018 --- pp_hot.c | 2 +- t/op/pat.t | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pp_hot.c b/pp_hot.c index 51229bb351..711b560b8b 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 237ea44c4e..3a4623d947 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"; +} -- cgit v1.2.1