Author: larry Date: Tue Aug 7 17:36:03 2007 New Revision: 14436 Modified: doc/trunk/design/syn/S04.pod
Log: Now require explicit termination of line-medial statements consistently. Modified: doc/trunk/design/syn/S04.pod ============================================================================== --- doc/trunk/design/syn/S04.pod (original) +++ doc/trunk/design/syn/S04.pod Tue Aug 7 17:36:03 2007 @@ -12,9 +12,9 @@ Maintainer: Larry Wall <[EMAIL PROTECTED]> Date: 19 Aug 2004 - Last Modified: 2 Jun 2007 + Last Modified: 7 Aug 2007 Number: 4 - Version: 59 + Version: 60 This document summarizes Apocalypse 4, which covers the block and statement syntax of Perl. @@ -173,6 +173,17 @@ sub f { 3 }; sub g { 3 }; sub f { 3 }; sub g { 3 } # the trailing semicolon is optional +Though certain control statements could conceivably be parsed in a +self-contained way, for visual consistency all statement-terminating +blocks that end in the middle of a line I<must> be terminated by +semicolon unless they are naturally terminated by some other statement +terminator: + + while yin() { yang() } say "done"; # ILLEGAL + while yin() { yang() }; say "done"; # okay, explicit semicolon + @yy := [ while yin() { yang() } ]; # okay within outer [...] + while yin() { yang() } ==> sort # okay, ==> separates statements + =head1 Conditional statements The C<if> and C<unless> statements work much as they do in