SOme example uses of the Translation Operator are:
$cnt = tr/Aa//;
After this statement executes, $cnt will hold the number of times the letter a appears in $_. The tr operator does not have an option to ignore the case of the string, so both upper- and lowercase need to be specified.
tr [\200-\377] [\000-\177];
This statement uses the square brackets to delimit the character lists. Notice that spaces can be used between the pairs of brackets to enhance readability of the lists. The octal values are used to specify the character ranges. The translation operator is more efficient-in this instance-than using logical operators and a loop statement. This is because the translation can be done by creating a simple lookup table.