Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language Perl

(bottled by Acme::EyeDrops)

Date:06/04/05
Author:Andrew Savige
URL:n/a
Comments:76
Info:http://search.cpan.org/dist/Acme-EyeDrops/lib/Acme/EyeDrops.pm
Score: (3.37 in 2958 votes)
    ''=~(        '(?{'        .('`'        |'%')        .('['        ^'-')
    .('`'        |'!')        .('`'        |',')        .'"'.        '\\$'
    .'=='        .('['        ^'+')        .('`'        |'/')        .('['
    ^'+')        .'||'        .(';'        &'=')        .(';'        &'=')
    .';-'        .'-'.        '\\$'        .'=;'        .('['        ^'(')
    .('['        ^'.')        .('`'        |'"')        .('!'        ^'+')
   .'_\\{'      .'(\\$'      .';=('.      '\\$=|'      ."\|".(      '`'^'.'
  ).(('`')|    '/').').'    .'\\"'.+(    '{'^'[').    ('`'|'"')    .('`'|'/'
 ).('['^'/')  .('['^'/').  ('`'|',').(  '`'|('%')).  '\\".\\"'.(  '['^('(')).
 '\\"'.('['^  '#').'!!--'  .'\\$=.\\"'  .('{'^'[').  ('`'|'/').(  '`'|"\&").(
 '{'^"\[").(  '`'|"\"").(  '`'|"\%").(  '`'|"\%").(  '['^(')')).  '\\").\\"'.
 ('{'^'[').(  '`'|"\/").(  '`'|"\.").(  '{'^"\[").(  '['^"\/").(  '`'|"\(").(
 '`'|"\%").(  '{'^"\[").(  '['^"\,").(  '`'|"\!").(  '`'|"\,").(  '`'|(',')).
 '\\"\\}'.+(  '['^"\+").(  '['^"\)").(  '`'|"\)").(  '`'|"\.").(  '['^('/')).
 '+_,\\",'.(  '{'^('[')).  ('\\$;!').(  '!'^"\+").(  '{'^"\/").(  '`'|"\!").(
 '`'|"\+").(  '`'|"\%").(  '{'^"\[").(  '`'|"\/").(  '`'|"\.").(  '`'|"\%").(
 '{'^"\[").(  '`'|"\$").(  '`'|"\/").(  '['^"\,").(  '`'|('.')).  ','.(('{')^
 '[').("\["^  '+').("\`"|  '!').("\["^  '(').("\["^  '(').("\{"^  '[').("\`"|
 ')').("\["^  '/').("\{"^  '[').("\`"|  '!').("\["^  ')').("\`"|  '/').("\["^
 '.').("\`"|  '.').("\`"|  '$')."\,".(  '!'^('+')).  '\\",_,\\"'  .'!'.("\!"^
 '+').("\!"^  '+').'\\"'.  ('['^',').(  '`'|"\(").(  '`'|"\)").(  '`'|"\,").(
 '`'|('%')).  '++\\$="})'  );$:=('.')^  '~';$~='@'|  '(';$^=')'^  '[';$/='`';

Download Source | Write Comment

Alternative Versions

VersionAuthorDateCommentsRate
for signatureRandolph Chung, Joey Hess04/20/050
standard versionJim Menard04/20/052
bottled versionChristopher J. Carlson05/17/057
Lingua::EN::InflectMarty Pauley04/20/051
minimal versionMark Sheppard06/01/051
object-oriented versionScott Bryce05/15/051
polyglotJeff Connelly04/20/050
BigIntAnonymous04/20/050

Comments

>>  jtull89 said on 06/09/05 21:54:28

jtull89 This isn't real. Delete it, please.

>>  Andrew Savige said on 06/12/05 05:38:54

Andrew Savige jtull89: What do you mean by "isn't real"? Did you try running the bottle-shaped program above? (it should work with perl version 5.005 and above).

>>  zerni said on 06/12/05 15:40:06

zerni lol, it works :DD

>>  thepacz said on 06/13/05 06:15:34

thepacz I was surprised to see a Perl program at the top of the list... but holy crap this is AWESOME! ...1337 1ND33D

>>  Skoons said on 06/17/05 21:14:28

Skoons Really greate. Super

>>  rendom said on 06/21/05 13:08:09

rendom Good job :D

>>  guertin said on 06/21/05 19:52:08

guertin This really does work. It is amazing. Download it and try it.

>>  Alan said on 06/21/05 22:23:18

Alan Unbelievable!

>>  anagark said on 06/22/05 19:08:15

anagark Awesome - a winner. I had to test it to believe it!

>>  David said on 06/24/05 11:12:41

David I'm amazed that really does work! Amazing!

>>  beer guy said on 07/01/05 05:58:11

beer guy Can someone explain why/how this works?

>>  Mephisto said on 07/02/05 02:43:40

Mephisto that's really amazing
a confusing language

>>  Andrew Savige said on 07/03/05 15:30:50

Andrew Savige beer guy: As for how this works, first notice
that Perl regular expressions are much more
powerful than traditional regular expressions:
you can, for example, execute Perl code inside
a regular expression, allowing you to solve
problems once thought "impossible" to solve
with regexps, such as matching arbitrarily
deeply nested parens ... or executing a
complete 99 bottle of beer program inside
a regexp. :-)
Second, notice that dynamic languages (such
as Perl and many others) allow you to build a
code string from an expression, then compile
and execute it on the fly. In this case, the
rather long expression is a series of
bit-twiddling operations joined together
with the string concat operator (.) producing
a 99 bottle of beer program string.
BTW, as this is a constant expression, the
Perl parser sees it more clearly than the
human reader (as you will discover if you
run perl -MO=Deparse beer.pl).

>>  MaxD said on 07/06/05 07:02:49

MaxD amazing

>>  zerni said on 07/09/05 02:29:26

zerni all u have to know is:
http://search.cpan.org/dist/Acme-EyeDrops/lib/Acme/EyeDrops.pm

>>  lone wolf McQuade said on 07/10/05 07:26:47

lone wolf McQuade chuck norris kicks ass. when he drinks pearl beer

>>  petru said on 07/22/05 14:26:32

petru geez man
Have you considered going to Obsfucated code competition? YOU'VE GOT SKILLS! ;-)

>>  Adramelek said on 07/27/05 20:03:50

Adramelek Brilliant.

>>  Brain said on 07/28/05 09:41:00

Brain Here is the original program:

use Acme::EyeDrops qw(sightly get_eye_string hjoin_shapes);
my $ninety_nine = <<'BURP';
$==pop||99;--$=;sub
_{($;=($=||No)." bottle"."s"x!!--$=." of beer")." on the wall"}
print+_,", $;!
Take one down, pass it around,
",_,"!

"while++$=
BURP
chop($ninety_nine); $ninety_nine =~ s/\nprint/print/;
print sightly( { Regex         => 1,
                 Compact       => 1,
                 ShapeString   => hjoin_shapes(2,
                                  (get_eye_string('bottle2'))x6),
                  SourceString  => $ninety_nine } );

It wasnt listed here but is interesting non the less, so i posted it here for reference (and for those who are too lazy to go to cpan)

>>  Brain said on 07/29/05 16:54:25

Brain Please see here http://www.99-bottles-of-beer.net/language-perl-658.html for the original bottled perl. This bottled perl script was made by passing the original perl script through a module, whereas the other bottled perl script was made by hand, which imho is a lot more impressive and deserving of merit.

>>  Andrew Savige said on 07/30/05 00:19:11

Andrew Savige Brain: I would agree with you if someone used a module written by somebody else. In this case, however, I wrote the module.
And writing a module capable of converting almost
any Perl program into almost any shape is imho a
lot "more impressive and deserving of merit" than
a script kiddie running around asking his friends
to vote for his script and downvote others. ;-)

>>  anuj said on 07/31/05 07:51:11

anuj Cool!! I can not wait I am going to DRINK it;) :d

>>  blutkehlchen said on 09/23/05 18:26:55

blutkehlchen very cool code ,i cant believe it !

>>  Greg said on 11/12/05 03:03:35

Greg Beautiful! Absolutely beautiful! I'm brand-new to the perl world (halfway through the llama book) and...and...wow... It works, and the code is even shaped like bottles! Ya know, I'm just going to give up now, 'cause I'll never be able to write anything that cool! :-)

-GRW

>>  Dick Gray said on 11/13/05 03:09:59

Dick Gray Good God, now I *really* need a beer! Thanks for the head-bending exercise in reading regexes on steroids.

>>  Geo.X said on 12/01/05 23:01:25

Geo.X I never had the chance to something like this; it is GREAT!

>>  lowercase said on 01/01/06 20:03:43

lowercase Awesome. I have just one question. The common-lisp program looks similiar. I mean, it also comes inside a bottle. I just wanted to know who did it first.

>>  Andrew Savige said on 01/08/06 03:52:53

Andrew Savige lowercase: To answer your question, I wrote mine in 2003, without having seen any of the other entries, and submitted it to this site two years later. I don't know when the Common Lisp one was written. Notice that these are not the only two entries shaped like a beer bottle; "Perl (bottled version)", for example, was created in 2001. I was hanging out at Perl Monks at the time (see http://www.perlmonks.org/?node_id=397958) so it felt completely normal (not original at all) to shape the code like a beer bottle. :-) It is perhaps more appropriate to honour the first person to get the crazy idea of pouring code into an ascii art shape. I don't know the answer to that either, but it was certainly being done in the 1980s, as evidenced by http://www.ioccc.org/1989/roemer.c and http://www.ioccc.org/1984/laman.c. HTH.

>>  Smokey Mc Pot said on 02/04/06 17:45:43

Smokey Mc Pot Awesome!!!

>>  tachi said on 02/14/06 20:50:49

tachi =]

>>  p07 said on 03/27/06 21:57:22

p07 FANTASTIC !!!!!!

>>  Puneet Madaan said on 04/05/06 13:05:58

Puneet Madaan cool code man...

Really cool,
i hav never seen such good compiled Regular Expression.
nice Work
Keep it up
;-)

>>  Puneet Madaan said on 04/06/06 14:43:28

Puneet Madaan hey you know,
6 bottles are still hanging in your code......
just check the script
LOL
;-)

>>  Family_Guy said on 04/12/06 11:33:53

Family_Guy You sir, are a god among men, this show the true potential of a dedicated programmer. It's unlike anything i've ever seen before. Nice job.

>>  gargoyle said on 04/14/06 23:51:39

gargoyle Awesome! My hat's off to you.

>>  Marcus said on 05/19/06 10:51:45

Marcus Nice GFX, but easy to achieve with the ACMEeyedrop script. The code behind the bottles is very nice and smart. *thumbsup*

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

>>  jtull89 said on 06/20/06 19:04:45

jtull89 Sorry for not believing in this program before. I just thought it was ASCII art.

>>  Dan said on 07/09/06 17:51:09

Dan Amazing. Totally cool. GG.

>>  Johnny805 said on 07/11/06 02:47:02

Johnny805 I'm just an average perl programmer for an internet company. I came by this site and I'm absolutely amazed by your perl scripts. Its really awesome. I would be curious to know how long it took you to write it, if you dont mind sharing.

>>  Noname said on 08/02/06 14:24:16

Noname Incredible!

>>  rorio said on 08/06/06 14:08:37

rorio Johnny805: http://search.cpan.org/dist/Acme-EyeDrops/lib/Acme/EyeDrops.pm

>>  John said on 09/28/06 13:37:59

John This language, "Language Perl(bottled by Acme::EyeDrops)", should be esoteric. It can't be maintained as it is. Perl can. This is just EyeDrops obfuscating the source. Please consider making this esoteric.

>>  Paul said on 04/05/07 19:34:54

Paul I agree with John. In it's current state this perl is esoteric.

>>  Fernando said on 04/16/07 09:44:38

Fernando Um, Marcus, I don't know if you missed the comment above or but he actually wrote
the ACME::EyeDrops as well.

So, technically, he wrote the camel code you posted too. ;D

>>  Mario said on 06/26/07 17:41:30

Mario Oh man! PERL SUCKS!! Try to write something useful not fooling around.

>>  Mauricio said on 07/03/07 00:50:51

Mauricio Mario, are you a programmer? or just wanted to share whatever it comes out of your brain? Perl is a very powerful language. Name something and I'l tell you who has done that ;) . Next time if you are not gonna say something good it's better you keep it.

>>  Gish said on 07/13/07 02:37:46

Gish Mauricio: Mario is looking at the perl above and saying it sucks. It's misrepresented as perl and I can see why he says that. This is not a representation of what perl looks like and I don't think it even has a place on this site other that a footnote. Gee how can I write a piece of code, and then make it unreadably pretty?

It's just dumb.

>>  SeaDog said on 09/21/07 21:55:23

SeaDog Gish, You Are Exactly right!

>>  AX said on 09/30/07 19:21:29

AX The fact that it exists, is a testament to awsome power of perl, oh, and beer

>>  Nuublet said on 12/30/07 00:31:57

Nuublet Thats pretty awesome. Now try doing the same with a C-- regex.

>>  Awesome Dude said on 02/23/08 09:05:17

Awesome Dude My sanity, where did it go? Holy crap that's awesome.

>>  fyury said on 02/27/08 14:54:17

fyury Get a perl it rox's mom ;) !!!

>>  Yeni Setiawan said on 07/29/08 08:29:43

Yeni Setiawan 1337!
Awesome, there's no az-09 at all but still print the 99 botles of beer.

>>  Uncle Cracker said on 08/06/08 21:16:46

Uncle Cracker This is brilliant! You are great and powerful!

>>  tbielawa said on 10/29/08 06:28:15

tbielawa outstanding

>>  Superman said on 11/21/08 14:40:13

Superman This is total garbage, it is not perl.

>>  La Nani said on 11/27/08 23:12:38

La Nani Eres un puto maquina

>>  WiFone said on 12/31/08 12:20:00

WiFone code is poetry ;-P

cheers!

>>  manuel said on 01/26/09 15:39:26

manuel muy bueno

>>  Jose Cuervo said on 02/10/09 22:36:24

Jose Cuervo Excellentomundo :)

Will this work in very large scripts, like 50Kb+ ?

I will try tonite before an answer is written... just curious to see what the Author has to say about that.

Amazing work!!!

>>  Henning said on 05/27/09 13:51:17

Henning The Perl power .... I love it !

>>  zack said on 05/31/09 18:31:54

zack doesn't work if you have the line 'use strict;' btw

>>  smu johnson said on 06/02/09 01:01:36

smu johnson Any of you guys above who said to take it down are retarded. Try copy and pasting that into Perl and seeing what happens before you let others publicly know how stupid you are first.

>>  12mrsaturns said on 07/09/09 08:28:24

12mrsaturns Yeah!
This is why Perl is my favorite language.

>>  Daniel Ruoso said on 10/08/09 04:41:17

Daniel Ruoso Just to note my thumbs up here...

>>  Alpheus said on 10/08/09 19:15:17

Alpheus This is impressive, in a sick sort of way. There are those who believe that this shows the power of Perl, to which I would have to say: Brainf*** must be a powerful language, too! but I'm not going to use it any time soon (for any serious work, at least...).

>>  patrick_airut said on 11/06/09 15:55:03

patrick_airut Great! Perfect code.

>>  Bob said on 11/07/09 04:45:09

Bob My eyes are filled with tears. Wonderful!

>>  mybeat said on 11/11/09 21:01:56

mybeat This is beautiful.
At first I was like Wha..? Will it work, and indeed it does.
Thank you

>>  Shiva said on 12/27/09 09:36:39

Shiva Absolutely fantastic!
Thanks for producing this.

>>  NAD said on 01/02/10 11:53:18

NAD Anyone who thinks this has any relationship to good programming should be permanently barred from programming anything for anyone, especially for a salary and especially when someone will have to come along and maintain their code.

>>  DD said on 01/11/10 21:50:19

DD NAD, don't be a doofus. This site has nothing to do with showing 'good programming', and I doubt anyone here thinks that a collection of obfuscated symbols is good programming.

>>  orm said on 02/17/10 20:53:16

orm How the fuck?

o.0

>>  Rugxulo said on 05/12/10 14:23:54

Rugxulo Dang it, Marcus, that camel isn't 99 bottles, it's spam to visit a forum. I hope the admins delete it now. >:-(

>>  Vloody said on 07/14/10 21:21:30

Vloody

>>  sysdef said on 07/21/10 13:28:51

sysdef lol, best of all! \o/

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: