There are two possible solutions that come to mind:
1. Have a list of all the variables that are defined prior to perl call. After the perl call, create a variable (a new perl script) that undefines these variables for the package.
1a. Keep moving variables to getVariable (ala getItemName) functions. Less undefines to do.
2. After a perl call is done, delete the package, and reload it. If I recall correctly, though, there are problems with deleting packages because of possible dependencies, etc. However, I seem to remember a safe_delete call in some perl docs somewhere. Not recommending this.. just another option.
|