summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-11-27 20:51:56 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-11-28 19:30:06 +0000
commit8f580fb8c3adcd8061f0e72f718bbf4ff930d697 (patch)
treeaf6f381f84ea6a17ce41b3bd1f28f207fe375cba /pod
parent5c5e4c245abefef949ee72dd179eff31d923dcb2 (diff)
downloadperl-8f580fb8c3adcd8061f0e72f718bbf4ff930d697.tar.gz
Change $#+
Message-Id: <199811280651.BAA18095@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2373
Diffstat (limited to 'pod')
-rw-r--r--pod/perlvar.pod23
1 files changed, 13 insertions, 10 deletions
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 7100af5b75..8c6305ccad 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -189,13 +189,14 @@ This variable is read-only.
$+[0] is the offset of the end of the last successfull match.
C<$+[>I<n>C<]> is the offset of the end of the substring matched by
-I<n>-th subpattern.
+I<n>-th subpattern, or undef if the subpattern did not match.
Thus after a match against $_, $& coincides with C<substr $_, $-[0],
-$+[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
-$+[>I<0>C<]> if C<$-[>I<n>C<]> is defined, and $+ conincides with
-C<substr $_, $-[-1], $+[-1]>. One can use C<$#+> to find the last
-matched subgroup in the last successful match. Compare with L<"@-">.
+$+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
+$+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with
+C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#+> to find the number
+of subgroups in the last successful match. Note the difference with
+C<$#->, which is the last I<matched> subgroup. Compare with L<"@-">.
=item $MULTILINE_MATCHING
@@ -410,13 +411,15 @@ channel. (Mnemonic: lines_on_page - lines_printed.)
$-[0] is the offset of the start of the last successfull match.
C<$-[>I<n>C<]> is the offset of the start of the substring matched by
-I<n>-th subpattern.
+I<n>-th subpattern, or undef if the subpattern did not match.
Thus after a match against $_, $& coincides with C<substr $_, $-[0],
-$+[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
-$+[>I<0>C<]> if C<$-[>I<n>C<]> is defined, and $+ conincides with
-C<substr $_, $-[-1], $+[-1]>. One can use C<$#-> to find the last
-matched subgroup in the last successful match. Compare with L<"@+">.
+$+[0] - $-[0]>. Similarly, C<$>I<n> coincides with C<substr $_, $-[>I<n>C<],
+$+[>I<n>C<] - $-[>I<n>C<]> if C<$-[>I<n>C<]> is defined, and $+ coincides with
+C<substr $_, $-[$#-], $+[$#-]>. One can use C<$#-> to find the last
+matched subgroup in the last successful match. Note the difference with
+C<$#+>, which is the number of subgroups in the regular expression. Compare
+with L<"@+">.
=item format_name HANDLE EXPR