http://www.perlmonks.org?node_id=79425


in reply to homepage.vbs decode

With tr it gets simpler:
tr/\017\020\021\022/\012\015\040\011/; #Gets the subst tr/\023-\200/\021-\176/; #converts ranges
If you need other ranges, they are easily made.

Jeroen<br. "We are not alone"(FZ) Oops.. alfie is right. Perl indeed only uses the first occurence of a char in the 'search' string, it is documented in perlop:

If multiple transliterations are given for a character, only the first one is used: tr/AAA/XYZ/ will transliterate any A to X.