Re: 'Dynamic scoping' of capture variables ($1, $2, etc.) (localization of captures in recursions is buggy!)by LanX (Chancellor)
|on Dec 16, 2012 at 21:03 UTC||Need Help??|
but if you read the docs differently
you can see that the next match within the recursion sets $1 to another value.
At least that's ATM my understanding of the designers intention.
> a branch to a point within the same block
no, no tail-head optimization in Perl!
I will try to run some experiments tomorrow.
hmm, w/o recursion and with different strings it works like localized:
you're right there is a bug in how recursive functions are handled:
in contrast explicitly different functions:
the following shows that $1 is static per function, maybe they where implemented like closures.