
-----------------------------------
apomb
Thu May 29, 2008 12:44 am

Obfuscated Perl
-----------------------------------
Fascinates the pants off me.

I always wondered how anyone could be so proficient at Unix/Perl that they could write something like this:/;{}def/#{def}def/$_={/Times-Bold exch selectfont}#/_{rmoveto}#/"{dup}#/*/!/$
;/q{exch}#/x ; {/J q #}#/.{/T q #}#{stringwidth}#{}#{}# 14 string dup dup dup
260 40 moveto 90 rotate ; %/}};$0='"\e

and the output be:
ThePerlJournalThePerlJournalThePerlJournalThePerlJournalThePerlJournalThePerl
J     l hePerlJou     hePerlJourn  ThePe   ournalThePerlJournalThePerlJou  al
The erl ournalTheP rlJ urnalThePer Journa ThePerlJournalThePerlJournalTheP rl
Jou nal hePer  our alT e  rl o  na ThePer Jo   a  heP r J  rn l  ePe   our al
The erl   rn lT eP    o rn l  eP r Journa T ePe l our a  he e  Jo rnalT eP rl
Jou nal he e    ur alTh    l ourna Th Per J urn l heP r Journ lTh Pe    ur al
The erl ou n lTheP rlJo rnal hePer Jo rna T ePe l our a ThePe lJo rn lT eP rl
Jou nal he er   u   lThe   l ourn   he   lJo   alT   er Jour   T   e    u   l
ThePerlJournalThePerlJournalThePerlJournalThePerlJournalThePerlJournalThePerl

Protip: Highlight the code part and squint or, if you run any type of unix (mac included) just copy the code as obfuscated.pl and run it at your command line ;)

-----------------------------------
rdrake
Thu May 29, 2008 1:33 am

Re: Obfuscated Perl
-----------------------------------
I could write Hello World in Perl and it'd still look obfuscated ;-).

Seriously though, I really love the camel:
#!/usr/bin/perl -w                                      # camel code
use strict;

                                           $_='ev
                                       al("seek\040D
           ATA,0,                  0;");foreach(1..3)
       {;}my               @camel1hump;my$camel;
  my$Camel  ;while(             ){$_=sprintf("%-6
9s",$_);my@dromedary           1=split(//);if(defined($
_=)){@camel1hum        p=split(//);}while(@dromeda
 ry1){my$camel1hump=0      ;my$CAMEL=3;if(defined($_=shif
        t(@dromedary1    ))&&/\S/){$camel1hump+=1