File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -140,8 +140,8 @@ Ways to match whitespace:
140
140
Beginners might expect a variable in a C < Capture > to supply its current
141
141
value when that C < Capture > is later used. For example:
142
142
143
- $perl6 -e 'my $a = 2; say($a, ++$a)'
144
- 33
143
+ $ perl6 -e 'my $a = 2; say join ',', ($a, ++$a)'
144
+ 3,3
145
145
146
146
Here the C < Capture > contained the B < container > pointed to by C < $a > and the
147
147
B < value > of the result of the expression C < ++$a > . Since the C < Capture > must
@@ -150,7 +150,7 @@ looks inside the container in C<$a> and so it may already be incremented.
150
150
151
151
Instead, use an expression that produces a value when you want a value.
152
152
153
- $perl6 -e 'my $a = 2; say(+$a, ++$a)'
154
- 23
153
+ $ perl6 -e 'my $a = 2; say join ',', (+$a, ++$a)'
154
+ 2,3
155
155
156
156
= end pod
You can’t perform that action at this time.
0 commit comments