有没有办法让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/