有没有办法让 Perl 6 不需要my
声明变量?我试过这个:
#!/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/