1) What is the proper syntax to declare a recursive regular expression using (??{ code })
I'd say, the only proper way is to not use it. (??{ }) (and (?{ })) have many problems. Scoping is one of them. (??{ }) is inefficient, not self contained, and in general, a PITA to use. On top of that, they're buggy. And may crash your program:
$ perl -wE '/(??{ s!!! })/' Use of uninitialized value $_ in substitution (s///) at (re_eval 1) li +ne 1. ... repeated many times ... Segmentation fault $
The reason the constructs are still marked experimental is that noone has stepped up and said "Not only do I know how to fix the issues, but here's a patch". For all we know, noone knows how to fix the issues.
Does anyone know what version of perl the following started throwing a strictures error our $x = qr/(??{ $x }/ and of course why.
Somewhere between 5.8.1 and 5.8.8. And probably due to a bug fix.
Can anyone think of a single instance where (??{ code }) would be used for recursive regular expressions over the (?PARNO) feature, or should that usage be deprecated from one's toolbox?
Only if code returns something different - perhaps because parameters are passed. Other than contrived examples, I cannot come up with something where I'd prefer to use such pattern.

In reply to Re: (??{ code }) versus (?PARNO) for recursive regular expressions by JavaFan
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.