Slickuser said:
I want to set a permanent environment on Windows and use it right
away.
None of this work, any help?
system("SET A=c");
Starts a new process, executes the SET command in that process, and then
terminates that process.
Starts a different new process, executes the SETX command in that
process, and terminates that process.
Starts yet a third new process, executes the echo command in that
process, and terminates that process.
print $ENV{'A'} . $ENV{'AB'};
And then prints the values of the environment variables A and AB as they
are set in the process, which is executing the Perl program and which
has nothing to do with the three earlier child processes..
If you want to set an environment variable in your Perl program/Perl
process then just do so:
$ENV{'A'} = 'c';
$ENV{'AB'} = 'BN';
Of course these settings will not be inherited by the parent process,
i.e. by the process that initiated the Perl process. If that's what you
had in mind then I suggest to consult
perldoc -q environment
jue