5

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?

Elizabeth Mattijsen
  • 25,654
  • 3
  • 75
  • 105
teodozjan
  • 913
  • 10
  • 35
  • possible duplicate of [How can I use Perl 5 modules from Perl 6?](http://stackoverflow.com/questions/9173043/how-can-i-use-perl-5-modules-from-perl-6) – user7610 Dec 06 '14 at 19:03

2 Answers2

10

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:

raiph
  • 31,607
  • 3
  • 62
  • 111
1

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.

teodozjan
  • 913
  • 10
  • 35