Cannot import Perl5 module using Inline::Perl5 into Perl6

前端 未结 2 1133
梦如初夏
梦如初夏 2021-01-18 11:39

I\'m trying to import a Perl5 module I really like https://metacpan.org/pod/Data::Printer using advice from the manual page https://modules.perl6.org/dist/Inline::Perl5:cpan

2条回答
  •  情书的邮戳
    2021-01-18 12:11

    From the github page, https://github.com/niner/Inline-Perl5/issues/128

    > perl6 -Ilib -e 'use Data::Printer:from; my @a = 1, 2, [3, 4, ${a => 1}]; p @a'
    [
        [0] 1,
        [1] 2,
        [2] [
            [0] 3,
            [1] 4,
            [2] {
                a   1
            } (tied to Perl6::Hash)
        ]
    ]
    

    I'm not particularly happy with this though. This is much more complicated than perl5 would have been. One of the main points of using Perl6 over Perl5 is simpler use and syntax. This isn't it. The 'Inline::Perl5' module should be able to be loaded within the script like every other module, not as an option at the command line.

提交回复
热议问题