- 论坛徽章:
- 145
|
回复 4# royalzhang
$ perldoc perlop
please search with "tr/" or "Transliterates" to see more detail information.
tr/SEARCHLIST/REPLACEMENTLIST/cds
y/SEARCHLIST/REPLACEMENTLIST/cds
Transliterates all occurrences of the characters found in the
search list with the corresponding character in the replacement
list. ...
--------------------------------------------
By the way,
if you want to delete something, you need the d option for tr function to do it.
if you want to mapping ASCII char 0 to 255, you can do follow way in tr function or some function(s///, m//,...) :
1. \xNN for Hexdecimal number
\x00-\xFF
2. \NNN for Octal number
\000-\377
|
|