From: David Nicol Date: Fri, 9 May 2008 18:14:29 +0000 (+0000) Subject: New separations for the pattern match operator documentation, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e9d89077a60de61f809018ce831b9605072266b7;p=p5sagit%2Fp5-mst-13.2.git New separations for the pattern match operator documentation, suggested by David Nicol: Subject: It's wafer thin! From: "David Nicol" Message-ID: <934f64a20805091114y40595f9ap9d355b39f20779c1@mail.gmail.com> p4raw-id: //depot/perl@33852 --- diff --git a/pod/perlop.pod b/pod/perlop.pod index 1827757..7cac1de 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1151,6 +1151,8 @@ the life of the script. However, mentioning C constitutes a promise that you won't change the variables in the pattern. If you change them, Perl won't even notice. See also L<"qr/STRING/msixpo">. +=item The empty pattern // + If the PATTERN evaluates to the empty string, the last I matched regular expression is used instead. In this case, only the C and C flags on the empty pattern is honoured - @@ -1167,6 +1169,8 @@ will assume you meant defined-or. If you meant the empty regex, just use parentheses or spaces to disambiguate, or even prefix the empty regex with an C (so C becomes C). +=item Matching in list context + If the C option is not used, C in list context returns a list consisting of the subexpressions matched by the parentheses in the pattern, i.e., (C<$1>, C<$2>, C<$3>...). (Note that here C<$1> etc. are @@ -1213,6 +1217,8 @@ search position to the beginning of the string, but you can avoid that by adding the C modifier (e.g. C). Modifying the target string also resets the search position. +=item \G assertion + You can intermix C matches with C, where C<\G> is a zero-width assertion that matches the exact position where the previous C, if any, left off. Without the C modifier, the C<\G> assertion