in reply to Please explain this JAPH
Sure. But if you'd like a hint first, think of shift ciphers.
The first part, $_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss' clearly sets $_ to that long string. Then comes the one tricky part. The transliteration operator comes into play, applied to $_ because of the =~ operator. Because Perl is nice, it lets you use any non-alphanumeric, non-whitespace character as delimiters. In this case, the ~ are delimiters; rewriting using /s, this would be y/b-v/a-z/s. Now, the y/// maps the character range b-v to a-z (although a-u suffices) first, which has the effect of changing the string to 'jjuussttaannootthheerrppeerrllhhaacckkeerr'. Finally, the transliteration operator has an option, /s which "squashes" duplicate characters. So we are done.
|
|---|