Skip to content

Commit 439ae20

Browse files
committed
Changed example refs #1739
It might be convenient also to use different examples that would cover different use cases, not only grep and map, but other "chaining" operators too.
1 parent 27d5f3f commit 439ae20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/Language/operators.pod6

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,17 +2473,17 @@ is not required for the very last routine/method).
24732473
.sort; # (4) Sort, result is <Earth People>
24742474
24752475
# To assign without the need of parentheses use another feed operator
2476-
my @result =
2477-
<people of earth>
2476+
my @result;
2477+
<people of earth>
24782478
==> map({ .tc })
24792479
==> grep /<[PE]>/
24802480
==> sort()
24812481
==> @result;
24822482
24832483
# It can be useful to capture a partial result, however, unlike
24842484
# the leftward feed operator, it does require parentheses or a semicolon
2485-
my @result =
2486-
<people of earth>
2485+
my @result;
2486+
<people of earth>
24872487
==> map({ .tc })
24882488
==> my @caps; @caps # also could wrap in parentheses instead
24892489
==> grep /<[PE]>/

0 commit comments

Comments
 (0)