加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl6 – 在Perl 6中关闭变量声明

发布时间:2020-12-16 06:15:58 所属栏目:大数据 来源:网络整理
导读:有没有办法让Perl 6不要求我声明变量?我试过这个: #!/usr/bin/perl6no strict;no warnings;$z = "hello world";say $z; 但那没用 ===SORRY!=== Error while compiling ./helloworld.plVariable '$z' is not declaredat ./helloworld.pl:5------ $z? = "hel
有没有办法让Perl 6不要求我声明变量?我试过这个:

#!/usr/bin/perl6
no strict;
no warnings;

$z = "hello world";
say $z;

但那没用

===SORRY!=== Error while compiling ./helloworld.pl
Variable '$z' is not declared
at ./helloworld.pl:5
------> $z? = "hello world";
    expecting any of:
        postfix

编辑:这是Rakudo的一个错误.参见Perl 6规范:http://design.perl6.org/S01.html官方Rakudo软件包似乎很快就会过时.建议您从源代码编译:http://rakudo.org/how-to-get-rakudo/

解决方法

没有严格;于2014年10月实施.

见:https://github.com/rakudo/rakudo/blob/nom/docs/ChangeLog#L547

没有没有警告;但是,因为无论如何都没有发出很多警告.大多数事情被认为是正确的或错误的.我们很少决定发出警告.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读