-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Ideally, it'd be nice to support sending extra environment variables to put in the spawned process of a run call.
Currently, the only way to achieve this is to set them in the parent beforehand, which has the non-ideal property of affecting the parent process itself. This may lead to data races or other side effects, and at least requires a local to avoid it having a longer effect than required.
{
local %ENV = %ENV;
$ENV{SOMEVAR} = "SOMEVALUE";
IPC::Run::run( ... );
}This also means the environment variable is still in effect for any callback code blocks passed as arguments into the run function.
Alternatively, if this isn't possible, the documentation should at least contain some sort of hint or example on how users can achieve this effect - perhaps using code similar to that given above, along with pointing out the limitations of that approach.