Regular Expressions
The Transpose Operator
-
- The transpose operator tr may also be applied to a target string using a
variant of the pattern matching syntax
$myString =~
tr/SEARCH/REPLACE/;
- The effect is that $myString will be modified if any SEARCH characters
match
$myString = "Bat";
$myString =~
tr/[a-z]/[A-Z]/; # Yields "BAT"