in reply to 5.10 regexes with subpatterns

You aren't doing anything wrong, this is how it works right now. DEFINE is for situations where you want to construct something like a validation routine from a grammar.

The issue of not being able to access named capture buffers after recursion actually applies to all capture buffers from a nested construct, such as when using (??{...}) and not just with named recursion. Its a limitation of the overall engine and its not likely to be changed or fixed anytime soon. (Especially as I have more things to do these days than I have time to do them even without considering Perl core hacking).

It has been discussed a number of times on #p5p that it would be nice to build a parse tree from named capture rules, but its enough work that it certainly wont be done in time for 5.10.0, maybe it will be done in a latter 5.10.x or even 5.12, but I cant say for sure.

---
$world=~s/war/peace/g