3

使用 Rakudo Star 2016.01 产品安装 Perl 6 非常简单。我按照这里的建议进行了手动安装:

perl Configure.pl --backend=moar --gen-moar --prefix=/opt/rakudo/rakudo-star-2016.01
make
make install

Perl6 现在安装在/opt/rakudo/rakudo-star-2016.01/bin

Panda 是 Rakudo 附带的 Perl 6 模块管理器,安装在/opt/rakudo/rakudo-star-2016.01/share/perl6/site/bin

然后我可以将两条路径都添加到 $PATH 变量中,以便立即运行 Perl6 安装。

我唯一的问题是 Perl 6 模块的默认安装仍在 $HOME 目录中:~/.perl6

但是,我也想安装 Perl 6 模块/opt,实际上是在/opt/perl/perl6

在运行上述安装步骤之前,我尝试设置 PERL6LIB 变量, export PERL6LIB=/opt/perl/perl6 但没有成功,因为仍然安装了模块~/.perl6

我如何告诉 Perl6 或 Panda 在我的 $HOME 目录之外的非标准位置安装模块?

4

1 回答 1

3

Setting PERL6LIB should suffice to specify the path where new Perl 6 modules will be installed. This variable can be set prior to Perl 6 installation.

export PERL6LIB="/opt/perl/perl6/lib" # or better is to put this line in .profile or .bash_profile
perl Configure.pl --backend=moar --gen-moar --prefix=/opt/rakudo-star/rakudo-star-2016.01
make && make install

This will install perl6 in /opt/rakudo-star/rakudo-star-2016.01/bin and panda in /opt/rakudo-star/rakudo-star-2016.01/share/perl6/site/bin

New modules can be installed with panda, e.g.

panda install Task::Star

and they should be found in /opt/perl/perl6/lib/.precomp (it's a hidden folder...)

During this installation ~/.perl6 is still created but should be empty.

于 2016-02-25T18:22:56.947 回答