http://qs1969.pair.com?node_id=572230


in reply to Re: Perl6ish rules in Perl5's regex engine
in thread Perl6ish rules in Perl5's regex engine

In this case there are two patterns (as your output shows). The first is the precompiled $qr and the second is that formed by concatenating the $qr into a larger pattern. You are correct that when processing the (??{$qr}) there is no recompile tho. When I said "many" I was thinking of scenarios where you would have multiple possible sub patterns (or rules), or where the (??{...}) returned a string instead of a pattern.

BTW, note it does eval the code everytime.... Even if it doesnt recompile the pattern.

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