Re: Question about matching time code evaluation in Perl
On Jan 8, 12:21 pm, frank.w.w...@gmail.com (Soldier) wrote: > Hi, > I came across these two pieces of codes, why would the "local $i=$i+1" > be backtracking-safe? > > $_ = 'lothlorien'; > m/ (?{ $i = 0 }) # Set $i to 0 > (. (?{ $i++ }) )* # Update $i, even af
Question about matching time code evaluation in Perl
Hi, I came across these two pieces of codes, why would the "local $i=$i+1" be backtracking-safe? $_ = 'lothlorien'; m/ (?{ $i = 0 })# Set $i to 0 (.(?{ $i++ }))* # Update $i, even after backtracking lori # Forces a backtrack