Perlito
Perlito copied to clipboard
Some Perl6 programs won't compile
I tried to run this program with the Perl6 compiler, but it won't compile:
# this example is from Rosetta Code:
# https://rosettacode.org/wiki/99_Bottles_of_Beer#Perl_6
my $b = 99;
repeat while --$b {
say "{b $b} on the wall";
say "{b $b}";
say "Take one down, pass it around";
say "{b $b-1} on the wall";
say "";
}
sub b($b) {
"$b bottle{'s' if $b != 1} of beer";
}
This is the error from the compiler log:
Compiling.
Emitting javascript.
Finished compilation unit at pos 320 of 320
Error:
{}
Compilation aborted.
Why does this program not compile?