in reply to Re^2: closure clarity, please
in thread closure clarity, please
You have no choice. Named subroutines are always global. You're lying to yourself when you said "local f".
You are right. I meant "define all subroutines at the same global level."
Why do you think that creating a variable somewhere should replace a variable in some unrelated sub?
It is not clear to me when a lexical variable is used and when is lost during the program execution, as in my last example, where I'd expect an uninitialized $a in all "local f"'s messages.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: closure clarity, please
by ikegami (Patriarch) on Nov 24, 2009 at 20:52 UTC | |
by JadeNB (Chaplain) on Nov 25, 2009 at 07:05 UTC | |
by ikegami (Patriarch) on Nov 25, 2009 at 07:09 UTC |