Skip to content

Commit 449d18c

Browse files
committed
Whitespace *is* allowed before the method period
1 parent 5d32afa commit 449d18c

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

doc/Language/5to6-nutshell.pod6

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,25 +162,31 @@ $n < 1; # Perl 6
162162
163163
=end item
164164
165-
However, note that you can use L<unspace|https://design.perl6.org/S02.html#Unspaces>
166-
to add whitespace in Perl 6 code in places where it is otherwise not
167-
allowed:
165+
=begin item
166+
I<However, whitespace is allowed before the period of a method call!>
168167
169168
=for code :lang<perl5>
170169
# Perl 5
171-
my @books = $xml->parse_file($file) # some comment
172-
->findnodes("/library/book");
170+
my @books = $xml
171+
->parse_file($file) # some comment
172+
->findnodes("/library/book");
173173
174174
=for code :preamble<no strict;>
175175
# Perl 6
176-
my @books = $xml.parse-file($file)\ # some comment
177-
.findnodes("/library/book");
176+
my @books = $xml
177+
.parse-file($file) # some comment
178+
.findnodes("/library/book");
179+
180+
=end item
181+
182+
However, note that you can use L<unspace|https://design.perl6.org/S02.html#Unspaces>
183+
to add whitespace in Perl 6 code in places where it is otherwise not
184+
allowed.
178185
179186
See also L<S03#Minimal whitespace DWIMmery|https://design.perl6.org/S03.html#Minimal_whitespace_DWIMmery> and
180187
L<S04#Statement parsing|https://design.perl6.org/S04.html#Statement_parsing>
181188
in the Perl 6 design docs.
182189
183-
184190
=head2 Sigils
185191
186192
In Perl 5, arrays and hashes use changing sigils depending on how they are

0 commit comments

Comments
 (0)