Are perl5 libraries are importable in perl6?

前提是你 提交于 2019-12-19 19:17:25

问题


I know that perl6 will definetely allow importing perl5 code but I'm not able to do this.

Here is perl6 code

use perl5:Net::FTP;

It reports an error

Is there any configuration issue or it is not ready yet?


回答1:


Use Inline::Perl5 to embed arbitrary Perl code in Raku or use Perl libraries as if they were Raku libraries.

Inline::Perl5 appropriately packages and wraps a regular perl interpreter in MoarVM so that Rakudo can interop with Perl. The combination already supports:

  • 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, 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.



回答2:


According to perlwiki

note: As of May 2012, none of the Perl 6 compilers yet implement this feature.

According to adventcalendar

Some basic modules are usable through slang feature but only a few of them like Config, Cwd and English are available.



来源:https://stackoverflow.com/questions/15382133/are-perl5-libraries-are-importable-in-perl6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!