Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by ysth (Canon)
on Apr 08, 2005 at 08:52 UTC ( #445977=note: print w/replies, xml ) Need Help??


in reply to How to use a variable in tr///

Use eval. Or use substitution with a hash instead (untested):
my %translit; # map chars in $orig to chars in $replace @translit{split //, $orig} = split //, $replace; $fname =~ s/(.)/defined($translit{$1}) ? $translit{$1} : $1/eg;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://445977]
help
Chatterbox?
[Happy-the-monk]: Moin !

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-07-23 08:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (459 votes). Check out past polls.

    Notices?