no module;
removes the imports of the module. I don't know if it frees memory too.
Have a look at perldoc -f use. | [reply] [d/l] [select] |
I gave a try at that...
It works fine for standard pragmas, but requires
an unimport function to exist in the package to unload.
That does not work for XML::DOM, or even Shell...
| [reply] |
Sorry, you are probably out of luck.
Once code is compiled, it stays around in memory. If the
module built up large data structures, you could try to
find a way to destroy them. But even if your program is
no longer using the memory, it is unlikely that your
operating system will be able to take the memory back
before you expire.
If you really, really need to do this, then the simplest
approach is to launch another process (or fork), have
that one load the module, do what needs to be done, then
exit. Since the memory was tied up in a process that
exited, it is all freed at once. | [reply] |