summaryrefslogtreecommitdiff
path: root/pod/perlretut.pod
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-05-06 12:34:59 +0100
committerDavid Mitchell <davem@iabyn.com>2013-05-06 12:34:59 +0100
commite1fd41328c84acca310fa893e8ccd99580bf7e7e (patch)
tree7700ac8bb1645897a0c993a1370984a76b5931b9 /pod/perlretut.pod
parent1e1a6340cf5801692cde83e25233130cfedd6d33 (diff)
downloadperl-e1fd41328c84acca310fa893e8ccd99580bf7e7e.tar.gz
Revert "Update docs to concur with $`,$&,$' changes"
This reverts commit d78f32f607952d58a998c5b7554572320dc57b2a. Since COW has now not been enabled by default for 5.18, revert the documentation changes which say that that $' etc no longer have a performance penalty, etc.
Diffstat (limited to 'pod/perlretut.pod')
-rw-r--r--pod/perlretut.pod12
1 files changed, 3 insertions, 9 deletions
diff --git a/pod/perlretut.pod b/pod/perlretut.pod
index 11ad1f64a3..bf4ab3bc29 100644
--- a/pod/perlretut.pod
+++ b/pod/perlretut.pod
@@ -900,10 +900,7 @@ of the string after the match. An example:
In the second match, C<$`> equals C<''> because the regexp matched at the
first character position in the string and stopped; it never saw the
-second 'the'.
-
-If your code is to run on Perl versions earlier than
-5.18, it is worthwhile to note that using C<$`> and C<$'>
+second 'the'. It is important to note that using C<$`> and C<$'>
slows down regexp matching quite a bit, while C<$&> slows it down to a
lesser extent, because if they are used in one regexp in a program,
they are generated for I<all> regexps in the program. So if raw
@@ -916,11 +913,8 @@ C<@+> instead:
$' is the same as substr( $x, $+[0] )
As of Perl 5.10, the C<${^PREMATCH}>, C<${^MATCH}> and C<${^POSTMATCH}>
-variables may be used. These are only set if the C</p> modifier is
-present. Consequently they do not penalize the rest of the program. In
-Perl 5.18, C<${^PREMATCH}>, C<${^MATCH}> and C<${^POSTMATCH}> are available
-whether the C</p> has been used or not (the modifier is ignored), and
-C<$`>, C<$'> and C<$&> do not cause any speed difference.
+variables may be used. These are only set if the C</p> modifier is present.
+Consequently they do not penalize the rest of the program.
=head2 Non-capturing groupings