in reply to Re: Re: Re: Re: what's faster than .=
in thread what's faster than .=

Perl 5 never GCs a sub's lexicals in the sense we're talking about here. Certainly things can happen to objects that go out of scope, but that's different.

Curiouser and curiouser (as someone famous, literally speaking, once said:).

Doesn't that imply that the often advised "scope as tightly as possible to reduce memory usage" is (at least some of the time) wrong? Or shouldn't I be asking such questions:)?


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.
  • Comment on Re: Re: Re: Re: Re: what's faster than .=

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: what's faster than .=
by perrin (Chancellor) on Jul 06, 2003 at 17:26 UTC
    Scoping tightly may reduce the number of separate variables needed, since more will be reused. In general though, if you want to free the memory from a lexical you have to undef it. This has been discussed many times on the mod_perl list and on PerlMonks as well. You can probably find some stuff about it with SuperSearch.