这是indexloc提供的服务,不要输入任何密码
Skip to content

Support for overriding %ENV vars in spawned process #178

@leonerd

Description

@leonerd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions