$from = 'abcdef'; $to = 'ghijkl'; eval qq{ tr/$from/$to/ };