From 4044502721ac7b89c6d21cf1099a3a518717eeba Mon Sep 17 00:00:00 2001
From: David Mitchell
Date: Wed, 24 Jul 2013 15:20:22 +0100
Subject: [PATCH] perlvar.pod: add a separate section on $& et al
Add a new separate section explaining the performance issues of $`, $&
and $'; plus descriptions of the various workarounds like @-, /p and COW,
and which perl version they were each introduced in.
Then in the entries for each individual var, strip out any commentary
about performance, and just include a link to the new performance
section.
---
pod/perlvar.pod | 86 ++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 58 insertions(+), 28 deletions(-)
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index a278d10..4d869f1 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -801,16 +801,51 @@ we have not made another match:
$1 is Mutt; $2 is Jeff
$1 is Wallace; $2 is Grommit
-The C and C
-modules can help you find uses of these
-problematic match variables in your code.
+=head3 Performance issues
-Since Perl v5.10.0, you can use the C
match operator flag and the
-C<${^PREMATCH}>, C<${^MATCH}>, and C<${^POSTMATCH}> variables instead
-so you only suffer the performance penalties.
+Traditionally in Perl, any use of any of the three variables C<$`>, C<$&>
+or C<$'> (or their C