in reply to Re: 'my' Variable life cycle
in thread 'my' Variable life cycle

So that I need to clean the large list and hash by myslef before I exit the function in order to release the memory?

Replies are listed 'Best First'.
Re^3: 'my' Variable life cycle
by chromatic (Archbishop) on Mar 07, 2008 at 16:06 UTC

    If you don't return that variable somehow from the function, Perl will reclaim the memory when the function returns. If you do return that variable somehow from the function, you probably don't want to release its memory.

Re^3: 'my' Variable life cycle
by dsheroh (Monsignor) on Mar 07, 2008 at 17:26 UTC
    No, if you want a variable's memory to be released when the function exits, you need to not return a reference to that variable.