Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'd like to work with creating an environment variable in perl and wait.
Then I would then allow an external process to change that environment variable.
The perl code will basically loop and wait until environment variable is set at say 0 then continue.
The following code does not work. changing the environment variable externally does not propogate to perl's environment variable setting even if I use setx or set. Looks like perl only sees the environment variables of it's own session.
Help.
`setx nas_scratch 0 -m`; (@queueitems)=split(/\s+/,$lineitem); foreach (@queueitems) { my $tapeid = $_; $ENV{NAS_SCRATCH}=$tapeid; ## shell out to Junction command using oprcmd? while ($ENV{NAS_SCRATCH} != 0) {## wait until external command finishes sleep(5); ## hold 5 secs and check again }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: working with enivornment variables in win32
by duff (Parson) on May 11, 2004 at 15:41 UTC | |
|
Re: working with enivornment variables in win32
by itub (Priest) on May 11, 2004 at 15:41 UTC | |
by bengmau (Beadle) on May 11, 2004 at 16:16 UTC | |
|
Re: working with enivornment variables in win32
by bengmau (Beadle) on May 11, 2004 at 15:39 UTC | |
|
Re: working with enivornment variables in win32
by hawtin (Prior) on May 12, 2004 at 09:23 UTC |