perl5 库是否可以在 perl6 中导入? [英] Are perl5 libraries are importable in perl6?
问题描述
我知道 perl6 将明确允许导入 perl5 代码,但我不能这样做.
I know that perl6 will definetely allow importing perl5 code but I'm not able to do this.
这是 perl6 代码>
Here is perl6 code
use perl5:Net::FTP;
它报告了一个错误
是否有任何配置问题或尚未准备好?
Is there any configuration issue or it is not ready yet?
推荐答案
使用 Inline::Perl5 将任意 Perl 代码嵌入 Raku 或 use
Perl 库,就像它们是 Raku 库一样.
Use Inline::Perl5 to embed arbitrary Perl code in Raku or use
Perl libraries as if they were Raku libraries.
Inline::Perl5 在 MoarVM 中适当地打包和包装了一个常规的 perl 解释器,以便 Rakudo 可以与 Perl 互操作.组合已经支持:
Inline::Perl5 appropriately packages and wraps a regular perl interpreter in MoarVM so that Rakudo can interop with Perl. The combination already supports:
使用
在 Raku 中使用 Perl 模块,包括使用 XS 的模块- 在 Raku 中使用 Perl 对象,反之亦然
- 用 Raku 编写 Perl 类的子类
use
ing Perl modules, including ones that use XS, in Raku- Using Perl objects in Raku and vice-versa
- Writing, in Raku, sub-classes of Perl classes
nine,Inline::Perl5 模块的作者,在 youtube 上做了一些关于它及其使用的演示:
nine, the author of the Inline::Perl5 module, has done some presentations about it and its use that are available on youtube:
- A 3 minute lightning talk about Inline::Perl5 that nine presented the day after the project began in 2014;
- Longer presentations about Inline::Perl5.
这篇关于perl5 库是否可以在 perl6 中导入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!