in reply to Re: Ghostly subroutine variables haunting me in subsequent calls
in thread Ghostly subroutine variables haunting me in subsequent calls
In my opinion, one of the worst things you can do with respect to subroutines is allow them to accept values through broader-scope "osmosis". My opinion is that all subroutine variables should be lexically scoped to the boundries of the subroutine.Huh?!? That's exactly what a closure does. And closures are useful!
Update: I hadn't noticed you mention closures yourself. I apologize. But in any case some caution is required IMHO before stating such a claim as the above. I.e. I wouldn't talk about "one of the worst things you can do...", but of "you must pay a lot of attention when you...", instead.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Ghostly subroutine variables haunting me in subsequent calls
by perrin (Chancellor) on Oct 25, 2005 at 17:26 UTC | |
by blazar (Canon) on Oct 25, 2005 at 17:36 UTC | |
|
Re^3: Ghostly subroutine variables haunting me in subsequent calls
by sauoq (Abbot) on Oct 25, 2005 at 19:14 UTC | |
|
Re^3: Ghostly subroutine variables haunting me in subsequent calls
by davido (Cardinal) on Oct 25, 2005 at 17:06 UTC |