Interesting that you use the word
program instead of
process. Is this intentional? On POSIX system, a program can be replaced within the same process using the
exec family of functions (Microsoft Windows does not have this feature). These functions replace the text, data, heap, and stack segments, so ordinary perl variables will be destroyed. Some areas of memory are retained between programs
within the same process. These include file descriptors and the environment block, so avoid unnecessary environment variables, and close all files before an exec.