File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,19 @@ warning. To execute the substitution on a variable that isn't the C<$_> this
183
183
operator uses, alias it to C < $_ > with C < given > , C < with > , or any other way.
184
184
Alternatively, use the L « C < .subst > method|/routine/subst» .
185
185
186
+ = head2 C < tr/// > in-place transliteration
187
+
188
+ my $str = 'old string';
189
+ $str ~~ tr/dol/wne/;
190
+ say $str; # OUTPUT: «new string»
191
+
192
+ Operates on C < $_ > topical variable, changing it in place. Behaves similar to
193
+ L « C < Str.trans > |/routine/trans» called with a single L < Pair > argument where
194
+ key is the matching part (characters C < dol > in example above) and value is
195
+ the replacement part (characters C < wne > in the example above). Accepts the
196
+ same adverbs as L « C < Str.trans > |/routine/trans» . Returns L < StrDistance > object
197
+ that measures the distance between original value and the resultant string.
198
+
186
199
= head1 Assignment Operators
187
200
188
201
Infix operators can be combined with the assignment operator to modify a
You can’t perform that action at this time.
0 commit comments