We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76d9da6 commit b93aca3Copy full SHA for b93aca3
doc/Language/operators.pod6
@@ -165,18 +165,18 @@ assignment operator to assign the replacement to the match part.
165
166
Infix operators can be combined with the assignment operator to modify a
167
value and apply the result to a container in one go. Containers will be
168
-autovivified if possible.
+autovivified if possible. Some examples:
169
170
my $a = 32;
171
- $a += 10; # 42
172
- $a -= 2; # 40
+ $a X<+=> 10; # 42
+ $a x<-=> 2; # 40
173
174
$a = 3;
175
$a min= 5; # still 3
176
$a min= 2; # 2
177
178
my $s = 'a';
179
- $s ~= 'b'; # 'ab'
+ $s x<~=> 'b'; # 'ab'
180
181
This behavior is automatically extended to include custom-defined infix operators.
182
0 commit comments