How can I set the Windows PATH variable from Perl?

后端 未结 3 978
时光取名叫无心
时光取名叫无心 2021-02-08 11:59

I need to set the an environment variable from within Perl. Ideally, I need to query a variable and then change it if it is not what is required. Specifically it is the PATH var

3条回答
  •  温柔的废话
    2021-02-08 12:18

    $ENV{PATH}?

    Keep in mind that environment variables only affect subprocesses, however. You can't run a Perl program, change %ENV, and then see that change in the parent process -- the environment does not work that way.

提交回复
热议问题