http://qs1969.pair.com?node_id=6615


in reply to Why Thrash Memory?

For the most part, Perl's garbage collection will handle discarding variables and cleaning up for you automatically. As you suggest, if you're mindful of the imminenet death of a variable scope, don't worry about calling undef.

With that in mind, there are a couple of places where you might want to massage things by hand.

The first is the only one I'd really worry about -- with some thoughtful programming, the second may never come up. I really don't worry about it much, as wise coding tends to minimize memory usage anyway.