In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/9af0006bddac3108a478ad921119bb41c07b088e?hp=e7245888eddac196db172b05d1c37f48debd2a10>

- Log -----------------------------------------------------------------
commit 9af0006bddac3108a478ad921119bb41c07b088e
Author: Zsban Ambrus <[email protected]>
Date:   Sun Jun 9 09:26:22 2013 -0400

    document the /p flag and related variables in delta
-----------------------------------------------------------------------

Summary of changes:
 pod/perl5100delta.pod |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/pod/perl5100delta.pod b/pod/perl5100delta.pod
index 4e5c6d3..10d71d6 100644
--- a/pod/perl5100delta.pod
+++ b/pod/perl5100delta.pod
@@ -200,6 +200,23 @@ logically match their complements.
 C<\R> matches a generic linebreak, that is, vertical whitespace, plus
 the multi-character sequence C<"\x0D\x0A">.
 
+=item Optional pre-match and post-match captures with the /p flag
+
+There is a new flag C</p> for regular expressions.  Using this
+makes the engine preserve a copy of the part of the matched string before
+the matching substring to the new special variable C<${^PREMATCH}>, the
+part after the matching substring to C<${^POSTMATCH}>, and the matched
+substring itself to C<${^MATCH}>.
+
+Perl is still able to store these substrings to the special variables
+C<$`>, C<$'>, C<$&>, but using these variables anywhere in the program
+adds a penalty to all regular expression matches, whereas if you use
+the C</p> flag and the new special variables instead, you pay only for
+the regular expressions where the flag is used.
+
+For more detail on the new variables, see L<perlvar>; for the use of
+the regular expression flag, see L<perlop> and L<perlre>.
+
 =back
 
 =head2 C<say()>

--
Perl5 Master Repository

Reply via email to