Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Setting $0 clears /proc/PID/environ too

by kikuchiyo (Friar)
on Jan 17, 2020 at 09:39 UTC ( #11111516=note: print w/replies, xml ) Need Help??

in reply to Re: Setting $0 clears /proc/PID/environ too
in thread Setting $0 clears /proc/PID/environ too

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.

  • Comment on Re^2: Setting $0 clears /proc/PID/environ too

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11111516]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2020-10-26 14:30 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (251 votes). Check out past polls.