...................
Because the transliteration 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 $@;
...................
Why don't invent a special modifier for such case? A modifier 'e' seems very
suitable. As well as modifier 'o' to compile once.
Migrated from rt.perl.org#1497 (status was 'resolved')
Searchable as RT1497$
The text was updated successfully, but these errors were encountered: