in reply to How does this "JAPH" work?
There are three statements in this JAPH:
Step one, assign some encrypted text to $_; the "it" variable (Perl's default variable). See perlvar for an explanation of $_.
Step two, transliterate. See perlop for an explanation of how tr/abc/def/ works, but the gist is that it walks through a string and changes any chcaracter found in the "abc" group to the character in the same position in the "def" list. Hence, if the string contains a "a", it would be replaced with a "d". The string that it acts upon by default is the one contained in $_.
Step three, print the contents of $_. print prints the contents of $_ if there is no other argument passed to it.
This is essentially a form of substitution cipher that leverages a couple of the terse shortcuts Perl offers to achieve a small degree of code illegibility.
Dave
|
|---|