summaryrefslogtreecommitdiff
path: root/pod/perlre.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-07-18 13:12:39 -0600
committerDavid Golden <dagolden@cpan.org>2010-07-19 01:04:59 -0400
commite1f120a9bcedababe219d448b4b0cb0b1153e992 (patch)
tree277d8935fce639a5c65becbe4b692db976540987 /pod/perlre.pod
parent388a738468888624b9ee18ce319fa7082b2df529 (diff)
downloadperl-e1f120a9bcedababe219d448b4b0cb0b1153e992.tar.gz
pods: mention \o{}, 3 octal digits
This patch adds a mention of \o{} to perlre to avoid the backreference ambiguities, and uses 3 octal digits in an example, and suggests using 3 digits where 2 were suggested before. Signed-off-by: David Golden <dagolden@cpan.org>
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r--pod/perlre.pod11
1 files changed, 6 insertions, 5 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod
index 2e00f0bc69..98aafdd184 100644
--- a/pod/perlre.pod
+++ b/pod/perlre.pod
@@ -450,11 +450,12 @@ capture group, or the character whose ordinal in octal is 010 (a backspace in
ASCII). Perl resolves this ambiguity by interpreting C<\10> as a backreference
only if at least 10 left parentheses have opened before it. Likewise C<\11> is
a backreference only if at least 11 left parentheses have opened before it.
-And so on. C<\1> through C<\9> are always interpreted as backreferences. You
-can minimize the ambiguity by always using C<\g> if you mean capturing groups;
-and always using 3 digits for octal constants, with the first always "0" (which
-works if there are 63 (= \077) or fewer capture groups). There are several
-examples below that illustrate these perils.
+And so on. C<\1> through C<\9> are always interpreted as backreferences.
+There are several examples below that illustrate these perils. You can avoid
+the ambiguity by always using C<\g{}> or C<\g> if you mean capturing groups;
+and for octal constants always using C<\o{}>, or for C<\077> and below, using 3
+digits padded with leading zeros, since a leading zero implies an octal
+constant.
The C<\I<digit>> notation also works in certain circumstances outside
the pattern. See L</Warning on \1 Instead of $1> below for details.)