use vars qw($x_re);
$x = qr/... (??{ $x }) .../
This of course worked, but we were quite excited when they released our with perl561delta. Near that point in time, the following did work as desired without throwing errors:
use strict;
our $x = qr/... (??{ $x }) .../
The thing as, as I understand the documentation of perlre, it should be allowed
This is a "postponed" regular subexpression. The code is evaluated at run time, at the moment this subexpression may match.
The whole point of being able to do a recursive regular expression is that you can include the qr// regex that you're currently defining. However, given the choices you listed above, I'd probably go with the following even if it does feel messy
our $x = qr/... (??{ our $x }) .../
Anyway, putting all that aside, I'd still like to get back to my primary question. Is this a feature that I should keep in my toolkit, or should I just drop it in favor of (?PARNO)? I can't think of any situation currently where I'd need the former over the latter, but I would like to know if y'all would consider still using it or not. |