Without commenting on anything the other two people have said, your use of lexicals and (??{...}) is incorrect. In general, unless you know perlguts you cannot intuit a non-buggy way to use these. Here is a proper way. Its far easier to just use globals - at least you don't need to know internals to reason about their operation.
my $reg; $reg = qr/...(??{sub{$reg}->()}.../;
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re: Complex regex and apparent failure of /g option
by diotalevi
in thread Complex regex and apparent failure of /g option
by lokiloki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |