Now I'm definitely going down the old memory train. When I first used the (??{ code }) feature, we had to declare our globals using vars.

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.


In reply to Re^4: (??{ code }) versus (?PARNO) for recursive regular expressions by wind
in thread (??{ code }) versus (?PARNO) for recursive regular expressions by wind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.