in reply to Re: Why is it uninitialized?
in thread Why is it uninitialized?

Except the effect of local also applies to the called subroutines,as shown by the our version. perlsub says:

A local modifies its listed variables to be "local" to the enclosing block, eval, or do FILE --and to any subroutine called from within that block. A local just gives temporary values to global (meaning package)
So while local is supposed to work across calls to subroutines, it's also supposed to work on variables which are present in the symbols table. I wouldn't expect a closure to keep the name of the variable, or whatever is used to make the localization work

Replies are listed 'Best First'.
Re^3: Why is it uninitialized?
by Laurent_R (Canon) on Dec 20, 2017 at 22:14 UTC
    Yeah, Eily, I understand your point.

    I am not quite sure, though, whether the sentence the variable is implicitly local to the loop and regains its former value upon exiting the loop is to be construed as meaning that it works as if the loop variable is localized with the local keyword.

      Yes you're right, as confirmed here.