Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

if-else and statement-ending blocks?

0 views
Skip to first unread message

Markus Laire

unread,
Oct 5, 2006, 2:43:30 PM10/5/06
to perl6-l...@perl.org
S04 says:
>A line ending with a closing brace "}", followed by nothing but whitespace or
>comments, will terminate a statement if an end of statement can occur there.
>That is, these two statements are equivalent:
>
> my $x = sub { 3 }
> my $x = sub { 3 };

Does this mean that
if $foo == 123 {
...
}
else {
...
}
is same as
if $foo == 123 {
...
}; # <-- notice the semicolon here
else {
...
}
because if-statement could end there.

--
Markus Laire

0 new messages