perl5 库是否可以在 perl6 中导入? [英] Are perl5 libraries are importable in perl6?

查看:77
本文介绍了perl5 库是否可以在 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 类的子类
  • useing 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:

  • 关于内联的 3 分钟闪电谈话:2014 年项目开始后的第二天,Perl5 就出现了九个;
  • 更长的演示关于内联::Perl5.立>
  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆