Skip to content

Commit 023e4a7

Browse files
committed
Clean up tr/// Perl 5 docs
- Remove mentions of speculations - Just link to Str.trans for docs - Mention TR///
1 parent 7351392 commit 023e4a7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

doc/Language/5to6-perlfunc.pod6

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,15 +1635,13 @@ Not available in Perl 6.
16351635
16361636
=item tr///
16371637
1638-
Works similarly to how it does in Perl 5. The one caveat is that ranges are specified differently.
1639-
Instead of using a range "a-z", you would use "a..z", i. e. with Perl's
1640-
range operator. In Perl 6, C<tr///> has a method version, which is
1641-
better documented, called C<.trans>. C<.trans> uses a list of pairs, as
1642-
follows: C<< $x.trans(['a'..'c'] => ['A'..'C'], ['d'..'q'] =>
1643-
['D'..'Q'], ['r'..'z'] => ['R'..'Z']); >> A much more extensive
1644-
description of the uses of C<.trans> can be found at
1645-
L<https://design.perl6.org/S05.html#Transliteration>. The C<y///>
1646-
equivalent has been done away with.
1638+
Works similarly to how it does in Perl 5. The one caveat is that ranges are
1639+
specified differently. Instead of using a range "a-z", you would use "a..z",
1640+
i.e. with Perl's range operator. In Perl 6, C<tr///> has a method version,
1641+
called L<trans>, which offers a few additional features.
1642+
1643+
Perl 5's C</r> flag is instead implemented as C<TR///> operator.
1644+
The C<y///> equivalent does not exist.
16471645
16481646
=head2 truncate
16491647

0 commit comments

Comments
 (0)