Okay, let's pull this one apart. First of all, there is a big
assignment to $_ (as in $_='....') which is then eval'ed. Cutting
this bit out, and leaving just the code, and cutting all the blanks
out gives us some perl code that can be fed to B::Deparse (this can be done with perl -MO=Deparse find-a-func >find-a-func.deparsed. Depending on your version of Perl a slew of warnings may be emitted. You can run the deparsed code to ensure the script still works correctly. In this case we strike it lucky -- it does). We
can then start to look at the code.

Here we grab the output of the backticked command "perldoc perltoc". The flip-flop operator
is used to isolate the section of interest from the line that contains
alpha (actually Alphabetical in the text) and the word Perl (what $; is currently)
down to the line that contains the word 'wait'. The %_ hash is
used to store all the Perl keywords (anything that is in lowercase).
Once we've done that we can transfer the hash keys to the @[ array.

A 20 x 15 grid is created. Each cell is set to an underscore. System
variables are used where possible to avoid the needless creation of lexicals (we
are running under strict, remember). The grid is unfolded out into a linear
string such that grid point (x,y) is mapped to (x*ylen)+y.

We loop through a number of times, 3 times the number of rows, or until we
have placed a bit less than half the Perl keywords in the grid. Hmm, not quite. As my inbox puts it Erudil says the line until ($%++ > 3 * $; or @] > 2 * $: - 3) { is used to keep the list from being longer than the grid.

Now try and place the word, letter by letter, walking away in the direction we started with. If the grid point being inspected is an
underscore, that means we haven't placed any letter there yet, which is cool, on the
other hand if it is a letter, and it is the same as the letter we want to place,
that's cool too (in fact, it's a big win for it means we've managed to position two (or more) words sharing a common position on the grid). Otherwise, if we collide, raise a llama flag and get out -- we are blocked by a word that has laid a prior claim to this grid point.

Print out the next word in the list of words to find. Then print a new line,
a raft of spaces ($" is just a space (by default), after all), and the next word after that. In this manner we get a nice airy layout.

update:Erudil pointed out a small B::Deparse artifact in my deconstruction. Corrected.

--

grinder

One of the things that I initially thought when I saw this obfu was that the llama copyright warning in the __DATA__ section was a significant part of the obfu; however, as Grinder's dissection above shows, it's just there.

Not to belittle Erudil's work, but I think an interesting take off of this would be to add just enough words to make the copyright notice into a pangram (a sentence containing every letter of the alphabet), and then modify:

into something that randomly picks a letter from this new __DATA__ section. The end effect would be about the same, except that now the distribution of random letters would closely mimic the english distribution ('eaton...') roughtly.

Of course, that would completely require Erudil to re-plot out the llama, since this change would probably add from 5 to 15 characters, and may not be possible to keep the code shape.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important

A very nice additional idea, Masem. I wouldn't change the copyright statement in any way, though. Just pick a random character from it, it is an English sentence at the moment so it already matches the distribution of letters (or at least as roughly as anything else) and the main point is just to get a random letter ... I don't think it's a problem if you never get an x.

Although the '&' might look a bit strange as a letter. And I don't think you can get that out of the copyright ;-)

Ada Lovelace for the palindrome
Albert Einstein for having smelly feet
Alfred Nobel for his contribution to battlefield science
Burkhard Heim for providing the missing link between science and mysticism
Claude Shannnon for riding a unicycle at night at MIT
Donald Knuth for being such a great organist
Edward Teller for being the template for Dr. Strangelove
Edwin Hubble for pretending to be a pipe-smoking English gentleman
Erwin Schrödinger for cruelty to cats
Hedy Lamarr for weaponizing pianos
Hugh Everett for immortality, especially for cats
Isaac Newton for his occult studies
Kikunae Ikeda for discovering the secrets of soy sauce
Larry Wall for his website
Louis Camille Maillard for discovering why steaks taste good
Marie Curie for the shiny stuff
Nikola Tesla for the cool cars
Paul Dirac for speaking one word per hour when socializing
Richard Feynman for his bongo skills
Robert Oppenheimer for his in-depth knowledge of the Bhagavad Gita
Rusi P Taleyarkhan for Cold Fusion
Sigmund Freud for his Ménage ā trois
Theodor W Adorno for his contribution to the reception of jazz
Wilhelm Röntgen for the foundations of body scanners
Yulii Borisovich Khariton for the Tsar Bomba
Other (please explain why)