Originally published on: Tue, 07 Jul 2009 11:33:26 +0000
In 1997, I entered a contest held by the publication The Perl Journal. It was their 1st annual Obfuscated Perl coding contest.
My entry in the category for simply printing "The Perl Journal" took 2nd place. ( You can now find this entry in the O'Reilly book Games, Diversions, and Perl Culture ).
I would like to briefly explain the genesis of my entry.
I had thought about listing my entry here, but I'm pretty certain that I don't own any kind of publication rights. One can still find it with a little Googling. However, the first two phases of the entry are still mine.
The program began with an idea that I had that involved allowing the Perl program read data from its own set of comments. The code opens itself as a file, loads its own source ( including the comments ).
To confuse the reader, I small p-machine and interpreted a short program to read from the comments and display The Perl Journal.
The associative array %c holds the code for the six instruction machine.
The symbolic instructions are as follows:
The p-machine program that performed the output was embedded in the Perl code as the string:
Once I had the p-machine interpreter, I needed to make the code more unreadable. I took half of the top portion of the code and half of the lower portion and then interlaced the characters of each. I added a for loop to the final code that separated the two halves, concatenated them, then called eval() to interpret the original program.
Unless otherwise noted, all code and text entries are Copyright ©2009 by James K. Lawless
Views expressed in this blog are those of the author and do not necessary reflect those of the author's employer. Views expressed in the comments are those of the responding individual.

Save to StumbleUpon
Digg it
Save to Reddit
Share on Facebook
Share on Twitter
More bookmarks
Click **here**
A JavaScript REPL for Android Devices
A Review of Kevin Mitnick's Book Ghost in the Wires
Play MP3 Files with Python on Windows
Mad Schemes : Learning Lisp via SICP
An Interview with Tom Zimmer: Forth System Developer
Twimmando: A Command-line Twitter Client
Internet Protocols and Rhino JavaScript
A Simple Media Control Interface Script Processor
Why Some Web Sites will go Dark on Jan 18th
Book Review : Paull Allen - Idea Man
A 90's Experiment in Online Systems - The U.S. West CommunityLink Service