in reply to How do you modify the Win32 PATH statement in a Perl script?
Use %ENV, or more specifically, $ENV{PATH}.
$ENV{PATH} = join ';', 'C:\\123', '"C:\\Program Files\\456"', $ENV{PATH};
or
$ENV{PATH} = qq{C:\\123;"C:\\Program Files\\456";$ENV{PATH}};
This changes the PATH for the current process. Children later launched by this process inherit this modified PATH (unless measures are taken to prevent this).
Update: Improved example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you modify the Win32 PATH statement in a Perl script?
by MoonShadow (Initiate) on Jan 20, 2009 at 18:56 UTC |