in reply to Re^6: sub fuction inside sub functioin?
in thread sub fuction inside sub functioin?
I must disagree. Having two variables or functions with the same name in the same scope is a bad idea.
There is no big point for using nested subs if they are not completely encapsulated
Some encapsulation is better than no encapsulation. The extra complications are not needed. Even with the extra complications, it's still not completely encapsulated.
# No Memory Leak!
You haven't changed anything. $inner still refers to the sub. The sub still captures $inner if the helper was recursive. The potential for a memory leak hasn't changed at all. You made it more complex for no gain.Eventually, $inner will be assigned a new value and stop referring to the helper. Nevermind.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: sub fuction inside sub functioin?
by LanX (Saint) on Dec 08, 2008 at 02:56 UTC | |
by ikegami (Patriarch) on Dec 08, 2008 at 03:09 UTC | |
by LanX (Saint) on Dec 08, 2008 at 11:10 UTC | |
by ikegami (Patriarch) on Dec 08, 2008 at 13:20 UTC | |
by LanX (Saint) on Dec 08, 2008 at 14:16 UTC | |
|