in reply to Re^7: (??{ code }) versus (?PARNO) for recursive regular expressions
in thread (??{ code }) versus (?PARNO) for recursive regular expressions

I've added the requested information to the previous reply. However, to be thorough, I've run the full script on v5.8.0 as well. When using our $x = qr/(??{ $x })/;, the script works as desired. However, when using my $x = qr/(??{ $x })/;, the script throws no strictures errors, but does throw a warning:

$ perl rec_regex.pl Use of uninitialized value in substitution iterator at perm.pl line 17 +, <DATA> line 1. <7> { ... } </7> <7> { { } } </7> { <7> { { } } </7> } { <3> { } </3> { <7> { { } } </7> } } <7> { ... } </7>

Additionally, as you can see it only does the second level of recursion again. Nevertheless, I never used my originally, so just sharing for addition data.

Also note, I just discovered that the original code DOES work currently if declared with our. It just won't pass strictures validation. Will update my original question with this data soon as I get back from pharmacy. Got a toothache coming on.

Replies are listed 'Best First'.
Re^9: (??{ code }) versus (?PARNO) for recursive regular expressions
by ikegami (Patriarch) on Mar 26, 2011 at 03:48 UTC

    However, when using my $x = qr/(??{ $x })/;, the script throws no strictures errors

    That's the bug I mentioned earlier. The use strict; didn't propagate into the (??{ }). (You're getting the warning because the second $x is the package variable.)

    I'm guessing the behaviour of our $x = qr/(??{ $x })/; changed when they fixed the pragma propagation.

    I'll file a bug report.