tallfred has asked for the wisdom of the Perl Monks concerning the following question:
My problem is I am writing test regression scripts in perl. Modifying %ENV doesn't actually call setenv() to change it for the OS to see, thus my kernel trick is not tested. How can I make perl "flush" the environment?
The perlvar man page says fork() causes the children to receive environment updates, but in my testing it is exec() which does the magic. Damn.
Sadly, calling system() or qx// or something that calls exec() does not flush the environment of the parent, only the child. :-(
In other words, I challenge you to modify /proc/self/environ in perl without calling exec().
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: true environment
by Zaxo (Archbishop) on Oct 30, 2003 at 03:13 UTC | |
by Abigail-II (Bishop) on Oct 30, 2003 at 09:41 UTC | |
|
Re: true environment
by PodMaster (Abbot) on Oct 30, 2003 at 03:33 UTC | |
|
Re: true environment
by ptkdb (Monk) on Oct 30, 2003 at 13:09 UTC | |
|
Re: true environment
by what (Initiate) on Oct 31, 2003 at 19:55 UTC | |
|
Re: true environment
by benizi (Hermit) on Oct 31, 2003 at 20:07 UTC |