in reply to How to eval a tr/// (was: Transliteration!!!)
Note the use of double quotes around the expression, as well as the backslash in front of "$var". The double quotes will cause interpolation of variables (variables in the string will be replaced by their values); the backslash causes the "$" in "$var" to be passed as a literal, so "eval" gets a string that begins with the four characters '$var', rather than one that begins with the current value (contents) of the variable "$var".eval "\$var =~ tr/$pattern1/$pattern2/";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to eval a tr/// (was: Transliteration!!!)
by demerphq (Chancellor) on Oct 21, 2002 at 01:08 UTC |