Obfuscated code (again)

Perl is notorious for its obscure syntax. Many people actually like Perl because of its syntax! In fact, it is possible to write very complex code in Perl with just a few characters, and at the same time, it is possible to write very simple programs in very obscure ways. Of course, there are many more people that hate Perl for the very same reason!

So, it should be a surprise to anyone that somebody came out with a library module for generating strange programs.
I will just show you one simple example of what it is possible to do with it: the following Perl programs was generated by Daniele, who also informed me on the existence of EyeDrops.

                       ''=~+(
                    '('.'?'.'{'
                  .('`'|'%').("\["^
        ((   '-'))).('`'|'!').("\`"|
      ',').'"'.('['^'+').('['^')').(
  '`'|')').('`'|'.').('['^'/').('{'
  ^'[').'\\'.'"'.('['^'-').('`'|
 ')').('['^'(').('`'|')').('['
 ^'/').('{'^'[').('`'|'(').('['
^'/').('['^'/').('['^'+')."\:".
'/'.'/'.('`'|'!').('`'|"\,").(
    '`'|"'"    ).('`'|('/')).(
     '`'|        ',').('`'|'!')
     .(           '`'|'.').("\`"|
                  '$').'.'.('['^','
                   ).('`'|'/').('['^
                   ')').('`'|('$')).(
              (     '[')^'+').('['^')'
           ).+(       '`'|'%').('['^'('
          ).''.         ('['^'(').('.').(
          "\`"|           '#').('`'|"\/").(
          "\`"|             '-').'/'.'\\'.'"'.';'
           .+(                '!'^'+').'"'."\}".
                                ')');$:='.'^'~';$~
             =(                     '@')|'(';$^="\)"^
        "\[";$/=                      '`'|'.';$,='('^'}'
        ;$\='`'|                        '!';$:=')'^"\}";$~=
         '*'|'`'                          ;$^='+'^'_'  ;($/)
         =('&')|                            "\@";$,=      '['
         &'~';$\                               =','        ^+
         '|';$:=                                '.'
         ^'~';$~                                ='@'|
         '('; $^                                 =')'^
          ((                                     '['))
                                                ;$/=
                                               '`'|
                               ( ((          '.'))
                              );$,='('^'}';$\= ((
                              '`'))|('!');$:=
                                 ')'^'}';$~=
                                    '*'|'`';
                                       ($^)=
                                         '+'

Save it as italy.pl, and then run it as perl italy.pl. Nice, uh? (Thanks a lot, Daniele!)

Advertisements

One thought on “Obfuscated code (again)

  1. Pingback: Frattanto nella blogosfera #48 « Ok, panico

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s