nahano
nahano

Reputation: 3835

Turn off variable declaration in Perl 6

Is there any way to make Perl 6 not require my to declare variables? I tried this:

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

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

But that didn't work

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

EDIT: This is a bug in Rakudo. See Perl 6 spec: http://design.perl6.org/S01.html The official Rakudo package appears to go out of date very quickly. It is recommended that you compile from source: http://rakudo.org/how-to-get-rakudo/

Upvotes: 4

Views: 260

Answers (1)

Tobias Leich
Tobias Leich

Reputation: 299

no strict; got implemented in October 2014.

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

There is no no warnings; though, as there are not many warnings emitted anyway. Mostly things are considered either correct or an error. Only rarely do we decide to make something warn.

Upvotes: 4

Related Questions