Re: Question about matching time code evaluation in Perl

2010-01-12 Thread C.DeRykus
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

2010-01-08 Thread Soldier
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