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?)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: secret code, transliteration prob
by henzcoop (Novice) on Apr 12, 2016 at 16:22 UTC

    Good question, Browser. The de-encryption step will take some thought. For now, though, I can at least make my very own cryptograms. Thanks for the feedback!

      For now, though, I can at least make my very own cryptograms.

      Not so useful if you can't decrypt them; but ...


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Cryptograms are simple substitution cipher problems you solve by hand. Not having the key, in this application, is the whole point.

        But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)