Skip to content

Commit e5f11c2

Browse files
committed
Built-ins with comma-less blocks now require a comma
1 parent 4856456 commit e5f11c2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/Language/5to6.pod

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,17 @@ Instead, use a C<NEXT> block within the body of the loop.
759759
=comment NOTE FOR EDITORS: When adding functions, please place them in
760760
alphabetical order.
761761
762+
=head3 Built-ins with bare blocks
763+
764+
Builtins that previously accepted a bare block followed, without
765+
a comma, by the remainder of the arguments will now
766+
require a comma between the block and the arguments e.g. C<map>, C<grep>,
767+
etc.
768+
769+
my @results = grep { $_ eq "bars" } @foo; # Perl 5
770+
my @results = grep { $_ eq "bars" }, @foo; # Perl 6
771+
772+
762773
=head3 C<delete>
763774
764775
Turned into an adverb of the
@@ -783,7 +794,6 @@ and L<C<[]> array subscripting|#[]_Array_indexing/slicing> operators.
783794
say "element exists" if exists $array[$i]; # Perl 5
784795
say "element exists" if @array[$i]:exists; # Perl 6 - use :exists adverb
785796
786-
787797
=head2 Regular Expressions ( Regex / Regexp )
788798
789799
=head3 Change C<=~> and C<!~> to C<~~> and C<!~~> .

0 commit comments

Comments
 (0)