From 7e7dae317603f267b98276b60ba434c40271b4da Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 18 Feb 2017 13:21:19 -0700 Subject: [PATCH] perlre: Don't name exact max non-consume depth 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 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pod/perlre.pod b/pod/perlre.pod index 90179a4..a9c83e4 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -1596,9 +1596,10 @@ L)>|/(?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)> C<(?-I)> C<(?+I)> 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 construct -- 1.8.3.1