According to perlop
:
tr/SEARCHLIST/REPLACEMENTLIST/cdsr
y/SEARCHLIST/REPLACEMENTLIST/cdsr
Transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list.For sed devotees, y is provided as a synonym for tr.
Options:
- c Complement the SEARCHLIST.
- d Delete found but unreplaced characters.
- s Squash duplicate replaced characters.
- r Return the modified string and leave the original string untouched.
If the REPLACEMENTLIST is empty, the SEARCHLIST is replicated.