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

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

by Roy Johnson (Monsignor)
on Apr 08, 2005 at 13:27 UTC ( #446013=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    eval sprintf "tr/%s/%s/", map quotemeta, $oldlist, $newlist;
    
  2. or download this
    eval "tr/\Q$oldlist\E/\Q$newlist\E/";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://446013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2018-11-21 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (234 votes). Check out past polls.

    Notices?