in reply to Re: Strange memory growth?
in thread Strange memory growth?
Ahh, now I see. There is the possibility that the if block is inside a loop, so perl will keep the lexical around so we don't have to recreate it on the next run through the loop.
So if this is really a problem, you could always do:
while($condition) { # do something $condition = 0; # Make sure condition is false at the end }
Please, only if you've anaylized the program and you really are in danger of running out of memory (including swap space) from the conditionals you're doing. Anything else is a micro-optimization.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Strange memory growth?
by liz (Monsignor) on Nov 07, 2003 at 22:38 UTC | |
|
Re: Re: Re: Strange memory growth?
by meetraz (Hermit) on Nov 07, 2003 at 22:14 UTC | |
by Anonymous Monk on Nov 09, 2003 at 18:05 UTC |