in reply to Re: closure clarity, please
in thread closure clarity, please
I did not know that a named sub is global no matter where it is defined, but how is that relevant? I definitely was looking at the sub's containing scope to determine what variables the sub could see at the time it's closure was formed.
However, knowing that a named sub is global no matter where it is defined, and knowing that a closure around a sub is formed at compile time doesn't give me any insight into which variables are contained in the closure. How do you figure that out?
And why does a my variable that is in scope inside the loop's block (in my last example) not make it into the closure?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: closure clarity, please
by ikegami (Patriarch) on Nov 24, 2009 at 23:17 UTC | |
by JadeNB (Chaplain) on Nov 25, 2009 at 06:58 UTC |