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
|