Author: moritz
Date: 2010-08-12 10:02:42 +0200 (Thu, 12 Aug 2010)
New Revision: 31964
Modified:
docs/Perl6/Spec/S05-regex.pod
Log:
[S05] saner defaults for :c and :p; without a previous match, $/.to blows up
Modified: docs/Perl6/Spec/S05-regex.pod
===================================================================
--- docs/Perl6/Spec/S05-regex.pod 2010-08-12 06:47:06 UTC (rev 31963)
+++ docs/Perl6/Spec/S05-regex.pod 2010-08-12 08:02:42 UTC (rev 31964)
@@ -278,7 +278,7 @@
=item *
The C<:c> (or C<:continue>) modifier causes the pattern to continue
-scanning from the specified position (defaulting to C<$/.to>):
+scanning from the specified position (defaulting to C<($/ ?? $/.to !! 0)>):
m:c($p)/ pattern / # start scanning at position $p
@@ -296,7 +296,7 @@
m:pos($p)/ pattern / # match at position $p
-If the argument is omitted, it defaults to C<$/.to>. (Unlike in
+If the argument is omitted, it defaults to C<($/ ?? $/.to !! 0)>. (Unlike in
PerlĀ 5, the string itself has no clue where its last match ended.)
All subrule matches are implicitly passed their starting position.
Likewise, the pattern you supply to a Perl macro's C<is parsed>