This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlre: Don't name exact max non-consume depth
authorKarl Williamson <khw@cpan.org>
Sat, 18 Feb 2017 20:21:19 +0000 (13:21 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 20 Feb 2017 16:08:55 +0000 (09:08 -0700)
In a couple of places, this pod says that 50 is the recursion limit in
patterns without consuming any input, but that it is changeable by
recompiling perl.  Therefore, we shouldn't specify the quantity, because
it might not be the correct value.  Further, 50 is currently wrong.

pod/perlre.pod

index 90179a4..a9c83e4 100644 (file)
@@ -1596,9 +1596,10 @@ L<C<(?I<PARNO>)>|/(?PARNO) (?-PARNO) (?+PARNO) (?R) (?0)>
 for a different, more efficient way to accomplish
 the same task.
 
-Executing a postponed regular expression 50 times without consuming any
-input string will result in a fatal error.  The maximum depth is compiled
-into perl, so changing it requires a custom build.
+Executing a postponed regular expression too many times without
+consuming any input string will also result in a fatal error.  The depth
+at which that happens is compiled into perl, so it can be changed with a
+custom build.
 
 =item C<(?I<PARNO>)> C<(?-I<PARNO>)> C<(?+I<PARNO>)> C<(?R)> C<(?0)>
 X<(?PARNO)> X<(?1)> X<(?R)> X<(?0)> X<(?-1)> X<(?+1)> X<(?-PARNO)> X<(?+PARNO)>
@@ -1663,9 +1664,9 @@ the output produced should be the following:
     $3 = bar(baz)+baz(bop)
 
 If there is no corresponding capture group defined, then it is a
-fatal error.  Recursing deeper than 50 times without consuming any input
-string will also result in a fatal error.  The maximum depth is compiled
-into perl, so changing it requires a custom build.
+fatal error.  Recursing deeply without consuming any input string will
+also result in a fatal error.  The depth at which that happens is
+compiled into perl, so it can be changed with a custom build.
 
 The following shows how using negative indexing can make it
 easier to embed recursive patterns inside of a C<qr//> construct