summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Pinyan <japhy@pobox.com>2001-03-03 12:14:07 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-04 18:07:48 +0000
commitdb615365202f390b6c9c07819116dcb70ebcf654 (patch)
tree48836e9957aa485d2e53b327f93619a8aa8e3dfd
parent7c95f590e1d3e90413f423893f54acc0b5dc228c (diff)
downloadperl-db615365202f390b6c9c07819116dcb70ebcf654.tar.gz
pattern in G_ARRAY context
Message-ID: <Pine.GSO.4.21.0103031712070.1035-100000@crusoe.crusoe.net> p4raw-id: //depot/perl@9018
-rw-r--r--pp_hot.c2
-rwxr-xr-xt/op/pat.t9
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";
+}