Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2018-09-20 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (178 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!