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


in reply to Re: How to use a variable in tr///
in thread How to use a variable in tr///

There is no transliteration built into s///g. The OP's example was tr/abc/def/. s/// can't do that without some help (some kind of lookup structure, or embedding a tr command in the eval'd replacement, and in that case, why not just eval?).

Caution: Contents may have been coded under pressure.