Does changing $0 destroy %ENV or does perl copy the environment out of the way before reusing the original environment block?
No, that happens very early, so even BEGIN blocks have %ENV correctly filled, and in any case later changes to %ENV are not reflected in /proc/PID/environ. That file is more like a historical record of what the environment was when the process started, and as such, it has potential (if marginal) uses, and that's why this bothers me.
In reply to Re^2: Setting $0 clears /proc/PID/environ too
by kikuchiyo
in thread Setting $0 clears /proc/PID/environ too
by kikuchiyo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |