Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Strange behaviour when regex variable is modified during match?by rsFalse (Chaplain) |
on Jan 17, 2021 at 16:51 UTC ( [id://11127038]=perlquestion: print w/replies, xml ) | Need Help?? |
rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
Hello. Today I found a strange behaviour in my sandbox program after I tried to soft-code a variable. Here is my code:
OUTPUT:
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. Perl v5.30.0 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?
Back to
Seekers of Perl Wisdom
|
|