in reply to Using variables with tr///
In the docs:
So you'll have to use eval for that. In which case, you may get better performance using s/// anyway; you'll have to benchmark it to check.Note that because the translation table is built at compile time, neither the SEARCHLIST nor the REPLACEMENTLIST are subjected to double quote interpolation. That means that if you want to use variables, you must use an eval(): eval "tr/$oldlist/$newlist/"; die $@ if $@; eval "tr/$oldlist/$newlist/, 1" or die $@;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Using variables with tr///
by cwest (Friar) on Jul 17, 2000 at 16:56 UTC |