my %translit; # map chars in $orig to chars in $replace @translit{split //, $orig} = split //, $replace; $fname =~ s/(.)/defined($translit{$1}) ? $translit{$1} : $1/eg;
In reply to Re: How to use a variable in tr///
by ysth
in thread How to use a variable in tr///
by perl-novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |