diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-15 13:05:11 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-23 15:07:18 +0200 |
commit | bfafcb9a4c258bd72d8c22f5d8af5edc8897f48e (patch) | |
tree | a135d8b491b022b33b80366d19ff0ba6f0c270b1 | |
parent | 730fb7e791962b4f698b07b82ae1213ced61a5e1 (diff) | |
download | perl-bfafcb9a4c258bd72d8c22f5d8af5edc8897f48e.tar.gz |
study now passes REXEC_SCREAM to the regex engine when SvSCREAM() is true.
This causes the regex engine to take advantage of the study data.
-rw-r--r-- | pod/perldelta.pod | 5 | ||||
-rw-r--r-- | pp.c | 2 | ||||
-rw-r--r-- | t/op/study.t | 9 |
3 files changed, 14 insertions, 2 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 1964832ab4..095785c629 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -71,6 +71,11 @@ may well be none in a stable release. The implementation of C<s///r> makes one fewer copy of the scalar's value. +=item * + +If a studied scalar is C<split> with a regex, the engine will now take +advantage of the C<study> data. + =back =head1 Modules and Pragmata @@ -6152,7 +6152,7 @@ PP(pp_split) I32 rex_return; PUTBACK; rex_return = CALLREGEXEC(rx, (char*)s, (char*)strend, (char*)orig, 1 , - sv, NULL, 0); + sv, NULL, SvSCREAM(sv) ? REXEC_SCREAM : 0); SPAGAIN; if (rex_return == 0) break; diff --git a/t/op/study.t b/t/op/study.t index 0e3ddb6bcb..adf5e2bfd6 100644 --- a/t/op/study.t +++ b/t/op/study.t @@ -7,7 +7,7 @@ BEGIN { } watchdog(10); -plan(tests => 29); +plan(tests => 30); use strict; use vars '$x'; @@ -85,3 +85,10 @@ TODO: { ok(!/G.F$/, 'bug 20010618.006'); ok(!/[F]F$/, 'bug 20010618.006'); } + +{ + my $a = 'QaaQaabQaabbQ'; + study $a; + my @a = split /aab*/, $a; + is("@a", 'Q Q Q Q', 'split with studied string passed to the regep engine'); +} |