perlquestion 7stud <p>Dear Monks,</p> <p>perlre says this:</p> <p><i> (??{ code })</i></p> <p><i> This is a "postponed" regular subexpression. The code is evaluated at run time, at the moment this subexpression may match. **The result of evaluation is considered a regular expression and matched as if it were inserted instead of this construct.**</i></p> <p>Then perlre says:</p> <i><p> Note that this means that the contents of capture groups defined inside an eval'ed pattern are not available outside of the pattern...</p> <p>...Thus,</p><code> ('a' x 100)=~/(??{'(.)' x 100})/</code> <p>will match, it will not set $1.</p></i> <p>Huh? I checked, and in fact $1 is not set. So in my opinion, the last quoted line should say:</p> <p><i>Despite the regex insertion, *confoundingly* the capture groups inside this construct are not available after the insertion.</i></p> <p>In other words, I don't see how by inserting the resulting regex instead of this construct it follows that the capture groups in the regex won't be available, which perlre seems to think is self-evident.</p>