summaryrefslogtreecommitdiff
path: root/pod/perlglossary.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-06-22 14:29:10 -0600
committerJesse Vincent <jesse@bestpractical.com>2010-06-28 22:30:04 -0400
commitd8b950dcbc51bd501c5dc196cc12d87eaf47b60c (patch)
treefd00ef847f27621f035f8c4fd827df582fa1433d /pod/perlglossary.pod
parentc27a5cfe2661343fcb3b4f58478604d8b59b20de (diff)
downloadperl-d8b950dcbc51bd501c5dc196cc12d87eaf47b60c.tar.gz
Prefer \g1 over \1 in pods
\g was added to avoid ambiguities that \digit causes. This updates the pod documentation to use \g in examples, and to prefer it when explaining the concepts. Some non-symmetrical outlined text dealing with it was also cleaned up.
Diffstat (limited to 'pod/perlglossary.pod')
-rw-r--r--pod/perlglossary.pod11
1 files changed, 6 insertions, 5 deletions
diff --git a/pod/perlglossary.pod b/pod/perlglossary.pod
index 858f24b12c..41dc412b57 100644
--- a/pod/perlglossary.pod
+++ b/pod/perlglossary.pod
@@ -234,13 +234,14 @@ some of its high-level ideas.
=item backreference
A substring L<captured|/capturing> by a subpattern within
-unadorned parentheses in a L</regex>, also referred to as a capture group.
-Backslashed decimal numbers
-(C<\1>, C<\2>, etc.) later in the same pattern refer back to the
-corresponding subpattern in the current match. Outside the pattern,
+unadorned parentheses in a L</regex>, also referred to as a capture group. The
+sequences (C<\g1>, C<\g2>, etc.) later in the same pattern refer back to
+the corresponding subpattern in the current match. Outside the pattern,
the numbered variables (C<$1>, C<$2>, etc.) continue to refer to these
same values, as long as the pattern was the last successful match of
-the current dynamic scope.
+the current dynamic scope. C<\g{-1}> can be used to refer to a group by
+relative rather than absolute position; and groups can be also be named, and
+referred to later by name rather than number. See L<perlre/Capture Buffers>.
=item backtracking