in reply to Re^6: Doing "it" only once
in thread Doing "it" only once
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.my $type; my $r = qr/(?{print "$type\n"})/; for (1..3) { $type = 'Regular'; /$r/; $type = 'Once only'; ?$r?; }
(update: But there's more to adding syntax than modifying the optree. It's gotta parse, too.)
|
|---|