How to export a shell variable within a Perl script?

前端 未结 6 643
天涯浪人
天涯浪人 2020-12-19 10:37

I have a shell script, with a list of shell variables, which is executed before entering a programming environment.

I want to use a Perl script to enter the programm

6条回答
  •  半阙折子戏
    2020-12-19 11:30

    This can now be done with the Env::Modify module

    use Env::Modify 'source';   # or use Env::Modify qw(source system);
    source("environment_defaults.sh");
    ... environment from  environment_defaults.sh  is now available
    ... to Perl and to the following 'system' call
    system("obe");
    

提交回复
热议问题