Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re^4: Tact and the Monasteryby talexb (Chancellor) |
on Sep 22, 2002 at 02:51 UTC ( [id://199835]=note: print w/replies, xml ) | Need Help?? |
I have to disagree: because I have declared a variable inside that block, it becomes a closure. When the closure ends, the variables cease to exist.
This is a Good Idea because it means the variables a) aren't sitting around waiting to Mess Things Up later on when the next piece of code uses variables with the same name and b) aren't using up memory that's no longer needed. Hence, my downvote.
--t. alex
Update:And sometimes I'm an idiot. You're absolutely right, that's not a closure. I was getting closure and scope mixed up. A scoped variable does disappear when it goes out of scope. A variable defined within a closure continues to exist for as long as the closure exists. My apologies.
In Section
Meditations
|
|