Ok, yes. That's because the m(...)'s (?{...}) is part of the optree and isn't being renewed each time. Using qr() wouldn't help because that'd have the same problem except now the closure would be bound to the qr() object.
An alternative idea interpolates a random value into a (?#...) comment node so every time the code executes the regex's string value is different and the regex is recompiled (of course, don't use /o on this).
/...(?{ ... })(?#@{[ rand ]})/In reply to Re: Re: Re: Variable scoping oddity inside (??{ ... })
by diotalevi
in thread Variable scoping oddity inside (??{ ... })
by Roger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |