C<$a>. If C<$b> is negative, then C<$a % $b> is C<$a> minus the
smallest multiple of C<$b> that is not less than C<$a> (i.e. the
result will be less than or equal to zero).
-Note than when C<use integer> is in scope, "%" give you direct access
+Note than when C<use integer> is in scope, "%" gives you direct access
to the modulus operator as implemented by your C compiler. This
operator is not as well defined for negative operands, but it will
execute faster.
# expand tabs to 8-column spacing
1 while s/\t+/' ' x (length($&)*8 - length($`)%8)/e;
-=item tr/SEARCHLIST/REPLACEMENTLIST/cdsUC
+=item tr/SEARCHLIST/REPLACEMENTLIST/cds
-=item y/SEARCHLIST/REPLACEMENTLIST/cdsUC
+=item y/SEARCHLIST/REPLACEMENTLIST/cds
Transliterates all occurrences of the characters found in the search list
with the corresponding character in the replacement list. It returns
c Complement the SEARCHLIST.
d Delete found but unreplaced characters.
s Squash duplicate replaced characters.
- U Translate to/from UTF-8.
- C Translate to/from 8-bit char (octet).
If the C</c> modifier is specified, the SEARCHLIST character set
is complemented. If the C</d> modifier is specified, any characters
This latter is useful for counting characters in a class or for
squashing character sequences in a class.
-The first C</U> or C</C> modifier applies to the left side of the translation.
-The second one applies to the right side. If present, these modifiers override
-the current utf8 state.
-
Examples:
$ARGV[1] =~ tr/A-Z/a-z/; # canonicalize to lower case
tr [\200-\377]
[\000-\177]; # delete 8th bit
- tr/\0-\xFF//CU; # change Latin-1 to Unicode
- tr/\0-\x{FF}//UC; # change Unicode to Latin-1
-
If multiple transliterations are given for a character, only the
first one is used: