| |||||||||||
| |||||||||||
Running another app with a changed environment Posted by enquirer (enquirer), 1 November 2002 I want to change an environment variable within my Perl, and have its new value seen within an appliaction that I shell off from witihn my PerlPosted by admin (Graham Ellis), 1 November 2002 In Perl, the environment is present in the %ENV hash, and that's both readable and writable. You'll find that if you change the environment like this, the new values are automatically exported to any shell commands you run in back quotes ... I've just done a couple of tests to confirm that this works because (quite honestly) I tought it was going to be much harder even though I knoew that it should work in theory.Following codes tested on Linux and OSX (darwin). Changes the OSTYPE variable, uses backquotes to run another piece of Perl (our second app) to report on the value of that second variable. Code:
This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |