|Keep It Simple, Stupid|
Strange behaviour when regex variable is modified during match?by rsFalse (Hermit)
|on Jan 17, 2021 at 16:51 UTC||Need Help??|
rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
Today I found a strange behaviour in my sandbox program after I tried to soft-code a variable. Here is my code:
The same code except one line being un-commented:
OUTPUT (is variable):
Output varies, but when I run similar code inside a FOR loop with ~1e4 iterations I got a similar small number of hash values.
I tried to minimize the code. But I can't find to how minimize it further.
I don't know why this strange behaviour occurs. It looks kinda bug? Ofc, I coded with very bad practice = I was changing my regex on the fly.
Problem with... backtracking? lexical $_ binded to $A?