in reply to secret code, transliteration prob
tr/// modifies the string you apply it to rather than returns the modified value. And, you need string eval not block eval:
eval "\$message =~ tr/abcdefghijklmnopqrstuvwxyz/$string/);
Note that you must escape $message, but not $string. After the above code, $message will contain the "secret code".
(One thing: How are you going to decrypt it, given that the encryption key will be lost when the program ends?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: secret code, transliteration prob
by henzcoop (Novice) on Apr 12, 2016 at 16:22 UTC | |
by BrowserUk (Patriarch) on Apr 12, 2016 at 17:33 UTC | |
by GotToBTru (Prior) on Apr 13, 2016 at 12:09 UTC |