How can I use the Environment Modules system in Perl?

前端 未结 3 757
遥遥无期
遥遥无期 2021-01-19 11:50

How can one use the Environment Modules system* in Perl?

Running

system(\"load module \");

does not work,

3条回答
  •  不知归路
    2021-01-19 12:34

    Alternately, to do it less perl-namespace like and more environment module shell-like, you can source the Environment Modules initialization perl code like the other shells:

    do( '/usr/share/Modules/init/perl');
    module('load use.own');
    print module('list'); 
    

    For a one-line example:

    perl -e "do ('/usr/share/Modules/init/perl');print module('list');"
    

    (This problem, "source perl environment module" uses such generic words, that it is almost un-searchable.)

提交回复
热议问题