in reply to Re: How to use a variable in tr///
in thread How to use a variable in tr///
Update: of course nobull's construction below is much clearer. It should have occurred to me to sayeval sprintf "tr/%s/%s/", map quotemeta, $oldlist, $newlist;
eval "tr/\Q$oldlist\E/\Q$newlist\E/";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to use a variable in tr///
by dmorelli (Scribe) on Apr 08, 2005 at 14:52 UTC | |
|
Re^3: How to use a variable in tr///
by nobull (Friar) on Apr 08, 2005 at 16:37 UTC |