alex (>):
> Code:
> loop (my $i = 0; $i <= 5; $i++;) { say }
>
> Result:
> ===SORRY!=== Error while compiling ./test.pl
> Missing block
> at ./test.pl:2
> ------> loop (my $i = 0; $i <= 5; $i++⏏;) { say }
Interesting failure mode.
That semicolon looks unnecessary but harmless to me. (It's of the
"statement-ending" kind, not the "statement-separating" kind that Perl usually
uses.) I wonder if it couldn't be possible to parse it correctly, but warn
about "useless semicolon".
As a further data point, Perl 5 also parsefails on the corresponding code:
$ perl -Mstrict -wE'for (my $i = 0; $i < 10; $i++;) { say $i }'
syntax error at -e line 1, near "++;"
Execution of -e aborted due to compilation errors.