in reply to Re^3: Is it safe to use external strings for regexes?
in thread Is it safe to use external strings for regexes?
> is only allowed within the scope of use re 'eval'; with "newer" Perls yes. I noticed that you changed it around 2013, and am thankful for that. *Um no, "use re 'eval'" has always been required to allow non-literal code blocks in patterns. The big "re eval" rewrite in 5.18.0 just made it smarter, so that for example a literal (and thus safe) code block could be interpolated into a run-time regex without needing the "use re 'eval'":
use re 'eval'; # ** no longer needed from 5.18.0 onwards $r = qr/xyz/; /(?{ foo() })$r/;
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Is it safe to use external strings for regexes?
by LanX (Saint) on Oct 07, 2021 at 20:50 UTC | |
by dave_the_m (Monsignor) on Oct 08, 2021 at 07:01 UTC | |
by LanX (Saint) on Oct 08, 2021 at 10:01 UTC |