@@ -102,15 +102,20 @@ if True {
102102say "world"
103103=end code
104104
105- =head2 Implied separator rule (for statements ending in blocks)
105+ =head2 Implied separator rule
106106
107- Complete statements ending in bare blocks can omit the trailing
108- semicolon, if no additional statements on the same line follow the
109- block's closing curly brace C<}>. This is called the "implied separator
110- rule." For example, you don't need to write a semicolon after an C<if>
111- statement block as seen above, and below.
107+ If the last code on a line (excluding an end of line comment) is the
108+ closing curly brace of either a block or a hash constructor literal,
109+ and it can be syntactically validly interpreted as the end of a
110+ statement, then a trailing semicolon is optional (and is typically
111+ omitted).
112+
113+ For example, you don't need to write a semicolon after assigning a
114+ curly braced literal hash to a variable, or after an C<if> statement
115+ block as seen above and below.
112116
113117=begin code
118+ my $hash = { :foo, :bar }
114119if True { say "Hello" }
115120say "world";
116121=end code
@@ -124,8 +129,9 @@ if True { say "Hello" }; say "world";
124129=end code
125130
126131This implied statement separator rule applies in other ways, besides
127- control statements, that could end with a bare block. For example, in
128- combination with the colon C<:> syntax for method calls.
132+ control statements, that could end with a bare block or curly brace
133+ hash literal. For example, in combination with the colon C<:> syntax
134+ for method calls.
129135
130136=begin code
131137my @names = <Foo Bar Baz>;
0 commit comments