in reply to Re: Re: better way to cleanup a package?
in thread better way to cleanup a package?
My tests show no difference in memory usage between undef *{"scalarvar"} and first undef ${"scalarvar"}. Perhaps you had a memory leak? My understanding is that Perl won't return the memory to the OS, just make it available to itself when freed. (Until the process terminates of course.)
As far as not clearing out sub packages, I think of that as a feature. It would be rare enough to want to clear out a package in this manner, so my feeling is that if you would want clear out sub-packages (which may or may not have a relationship to the package being deleted) you should be explicit.
-Lee
"To be civilized is to deny one's nature."