Doc tweaks.
[p5sagit/p5-mst-13.2.git] / pod / perlop.pod
index 73564ef..6785d24 100644 (file)
@@ -395,10 +395,10 @@ Using "or" for assignment is unlikely to do what you want; see below.
 
 Binary ".." is the range operator, which is really two different
 operators depending on the context.  In list context, it returns an
-array of values counting (up by ones) from the left value to the right
+list of values counting (up by ones) from the left value to the right
 value.  If the left value is greater than the right value then it
 returns the empty array.  The range operator is useful for writing
-C<foreach (1..10)> loops and for doing slice operations on arrays.  In
+C<foreach (1..10)> loops and for doing slice operations on arrays. In
 the current implementation, no temporary array is created when the
 range operator is used as the expression in C<foreach> loops, but older
 versions of Perl might burn a lot of memory when you write something
@@ -408,6 +408,9 @@ like this:
        # code
     }
 
+The range operator also works on strings, using the magical auto-increment,
+see below.
+
 In scalar context, ".." returns a boolean value.  The operator is
 bistable, like a flip-flop, and emulates the line-range (comma) operator
 of B<sed>, B<awk>, and various editors.  Each ".." operator maintains its
@@ -462,7 +465,7 @@ can say
 
     @alphabet = ('A' .. 'Z');
 
-to get all normal letters of the alphabet, or
+to get all normal letters of the English alphabet, or
 
     $hexdigit = (0 .. 9, 'a' .. 'f')[$num & 15];
 
@@ -838,7 +841,11 @@ that you won't change the variables in the pattern.  If you change them,
 Perl won't even notice.  See also L<"qr/STRING/imosx">.
 
 If the PATTERN evaluates to the empty string, the last
-I<successfully> matched regular expression is used instead.
+I<successfully> matched regular expression is used instead. In this
+case, only the C<g> and C<c> flags on the empty pattern is honoured -
+the other flags are taken from the original pattern. If no match has
+previously succeeded, this will (silently) act instead as a genuine
+empty pattern (which will always match).
 
 If the C</g> option is not used, C<m//> in list context returns a
 list consisting of the subexpressions matched by the parentheses in the
@@ -892,7 +899,8 @@ C<m//g>, if any, left off.  Without the C</g> modifier, the C<\G> assertion
 still anchors at pos(), but the match is of course only attempted once.
 Using C<\G> without C</g> on a target string that has not previously had a
 C</g> match applied to it is the same as using the C<\A> assertion to match
-the beginning of the string.
+the beginning of the string.  Note also that, currently, C<\G> is only
+properly supported when anchored at the very beginning of the pattern.
 
 Examples: