I have some legacy perl script, which sets environment variable
$ENV{"ENV_VAR_NAME"} = $envVar;
and then uses qx() to execute another shell command
$command = "$xyz";
$result = qx($command);
Will the modified ENV_VAR_NAME be available when qx executes the new command.
Yes.
perlvar
says about%ENV
:And
qx
does indeed spawn a child process, which can therefore access your modified environment variables.This can be easily tested: