Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by ysth (Canon)
on Apr 08, 2005 at 08:52 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://445977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found