【发布时间】:2019-12-02 02:05:42
【问题描述】:
要么我错过了它,要么没有关于该主题的明确信息。
我应该在哪里寻找 Perl 6 库? CPAN.org?还是只有http://modules.perl6.org?
当我选择了一个后,如何将它添加到我的 Perl 6 项目中?
如果我在 GitHub 上找到它,如何将它添加到我的 Perl 6 项目中?
【问题讨论】:
标签: module dependencies raku zef
要么我错过了它,要么没有关于该主题的明确信息。
我应该在哪里寻找 Perl 6 库? CPAN.org?还是只有http://modules.perl6.org?
当我选择了一个后,如何将它添加到我的 Perl 6 项目中?
如果我在 GitHub 上找到它,如何将它添加到我的 Perl 6 项目中?
【问题讨论】:
标签: module dependencies raku zef
请务必阅读@smonff 的回答,以及对问题 2 和 3 的回答。
- 我应该在哪里寻找 perl 6 库?
- 当我选择了一个之后,如何将它添加到我的 perl 6 项目中?
使用zef 将其安装在您的本地系统上。
阅读the modules doc page 了解有关use在项目中使用模块的说明。
- 如果我在 [某处] 找到它,如何将它添加到我的 perl 6 项目中?
如果 zef 可以看到它(如果模块的 repo 在 modules.perl6.org 中列出,zef 通常可以看到一个模块)那么 zef 应该能够安装它。如果没有,请联系作者或在#perl6 上询问。
【讨论】:
作为对第 2) 和 3) 点的回答,您可以查看6pm。它的想法是 NPM for Perl6。它也可以与 Perl5 的 Carton 进行比较。 6pm 在 Zef 上工作。
$ 6pm init
# Install dependencies to ./perl6-modules and add it to META6.json
$ 6pm install Test::Meta --save
# Run a file using the local dependencies
$ 6pm exec-file test.p6
# Make your code always use 6pm by making it "use SixPM;"
$ perl6 test.p6
请参阅full documentation 了解更多信息。
【讨论】: