in reply to Re^6: Doing "it" only once
in thread Doing "it" only once

This code illustrates that the op only performs the match once:
my $type; my $r = qr/(?{print "$type\n"})/; for (1..3) { $type = 'Regular'; /$r/; $type = 'Once only'; ?$r?; }
On the broader subject of modifying the optree...well, it hasn't really occurred to me very often. The most common reason to do it is to introduce new syntax, which I guess is what you're suggesting, after a fashion. If I were up to it, I would probably want to implement a new operator.

(update: But there's more to adding syntax than modifying the optree. It's gotta parse, too.)


Caution: Contents may have been coded under pressure.