Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Syntactic Confectionery Delight
 
PerlMonks  

a poem

by Anonymous Monk
on Jan 05, 2006 at 08:49 UTC ( #521141=obfuscated: print w/ replies, xml ) Need Help??

Just came across this one:
#!/usr/bin/perl sub __{$_[0]=~y-=#&!~_`'.+,/<>():;?- .,eintsrahgldmfopv-;print@_} sub _{($,,$:)=split/=/,$_[0],2;$* =$*?"$:$*":$:;__ "O_=`,!=$,=>+y=:)=C,r~'`(+'=(y=`.u!=<:?!=/+?!=`:=(!$/$*#$/$/"}map{_$_ }")~.'`=+=;+.`.~>/!=~_=+=;!+.=`.!!","'!c:_>=`w:=`u.`<!=>:?!'=+_>=" ,"`,~.>=`,.!!=).!_c,=,!_'&=","):u.`,=):u.=c+<<~_/=b~.>'&$/" ,")~)`,=)~?!=/:<>!_=.~_/'&=","'~x`,='~x=/!!'!=+-<+y~_/&=" ,"'!?!_`,='!?!_='w+_'=+-'w~((~_/&$/","!~/,`,=!~/,`=(+~> '=+-(~<k~_/&=" ,"_~_`,=_~_!=<+>~!'=>+_c~_/&=","`!_`,=`!_=<:.>'=+-<!+;~_/&$/" ,"!<!?!_`,=!<!?!_=;~;!.'=;~;~_/&=","`w!<)`,=`w!<?!=>.u((!.'=>.u((~_/&=
What it does is nothing but generate the following poem :
On the first day of Christmas my true love gave to me a partridge in a pear tree. On the second day of Christmas my true love gave to me two turtle doves and a partridge in a pear tree. On the third day of Christmas my true love gave to me three french hens, two turtle doves and a partridge in a pear tree. On the fourth day of Christmas my true love gave to me four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the fifth day of Christmas my true love gave to me five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the sixth day of Christmas my true love gave to me six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the seventh day of Christmas my true love gave to me seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the eighth day of Christmas my true love gave to me eight maid s a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the ninth day of Christmas my true love gave to me nine ladies dancing, eight maid s a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the tenth day of Christmas my true love gave to me ten lords a-leaping, nine ladies dancing, eight maid s a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the eleventh day of Christmas my true love gave to me eleven pipers piping, ten lords a-leaping, nine ladies dancing, eight maid s a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree. On the twelfth day of Christmas my true love gave to me twelve drummers drumming, eleven pipers piping, ten lords a-leaping, nine ladies dancing, eight maid s a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three french hens, two turtle doves and a partridge in a pear tree.
cheers!

Comment on a poem
Select or Download Code
Re: a poem
by Anonymous Monk on Jan 05, 2006 at 08:52 UTC
    uh... it's missing a Quotation Mark at the end sorry...
    #!/usr/bin/perl sub __{$_[0]=~y-=#&!~_`'.+,/<>():;?- .,eintsrahgldmfopv-;print@_} sub _{($,,$:)=split/=/,$_[0],2;$* =$*?"$:$*":$:;__ "O_=`,!=$,=>+y=:)=C,r~'`(+'=(y=`.u!=<:?!=/+?!=`:=(!$/$*#$/$/"}map{_$_ }")~.'`=+=;+.`.~>/!=~_=+=;!+.=`.!!","'!c:_>=`w:=`u.`<!=>:?!'=+_>=" ,"`,~.>=`,.!!=).!_c,=,!_'&=","):u.`,=):u.=c+<<~_/=b~.>'&$/" ,")~)`,=)~?!=/:<>!_=.~_/'&=","'~x`,='~x=/!!'!=+-<+y~_/&=" ,"'!?!_`,='!?!_='w+_'=+-'w~((~_/&$/","!~/,`,=!~/,`=(+~> '=+-(~<k~_/&=" ,"_~_`,=_~_!=<+>~!'=>+_c~_/&=","`!_`,=`!_=<:.>'=+-<!+;~_/&$/" ,"!<!?!_`,=!<!?!_=;~;!.'=;~;~_/&=","`w!<)`,=`w!<?!=>.u((!.'=>.u((~_/&= "

      When running this, I'm getting strange newlines in

      eight maid s a-milking,
Re: a poem
by Happy-the-monk (Prior) on Jan 05, 2006 at 09:45 UTC

    Where did you find it?

    Cheers, Sören

Re: a poem
by ambrus (Abbot) on Jan 05, 2006 at 11:27 UTC

    Wow, this is 90 chars shorter than what I get if I LZ77-compress it (see this old obfu of mine: LZ77 compression).

    sub j{'dr~Tt~~~wM~|t[~}r{~}ly~|dW~{sI~|n~}|aG~[tz~}iu~}d}}Sh1~{ w~}ry~ }n"~}h|~}hB||s~~~,|~|wQ}Gfm~}uD~|hr~Tf\\{{ "~}aX~}l<~|g|~}bw|{s9|{hH|3 iw~}tX{RiV~zoX~}d|~}r${{s~~~;.{ h&~{i~~~xY{RsIx| ?~|e$~| p~}-X~}ao~}i# {|,x~{vYy r3~mvB||tFxReRv{ t~}wB}|sqw{sR}}id~}m${{,{w aA}Wev~}gz~}tX{S eCtz d~|i|z| pw|mv~}l~~~kkwys"v e;|An<~|tX{Sn<~|eY~|aq~}iE}| q~|n"~}ij wzers g!{*tQvPt v{lm~}rjsyl6~|pouynMq lTy eNtslSvNeRly dn|py~}rb~|pxk| ijwztrn esw r9}^wSl|f@oQwSl|vJ}{r[~}mK~|rDq{roh{i=qyl~k nxu tN}Q'=~ /./g?ord$&:die$_}do{$_.=chr(j).substr($_,12096-&j-95*j,126-&j)until 0} if s""On the first day of Christmas my true love gave to me a partridge in a pear tree.\n\nOn the secon"
Re: a poem
by liverpole (Monsignor) on Jan 05, 2006 at 13:19 UTC
    I'm really not sure why this got posted here.  It's just a copy of a response of mine in this thread, which is also at Perlmonks ...??

    Update:  Oh, and the strange newline which ambrus mentioned was caused by a newline which got introduced into the code.  Now I'm curious -- was this actually on the Internet somewhere, and ironically made its way back to the same place it came from?  Hey, Anonymous Monk, where did you find this?


    @ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"
      Yes, I was pretty sure I had seen it recently as well: Re: perl v/s C

      (Sorry, I know I'm replying to your message where you point this out, but I went through the trouble of finding it before reading that you had already replied, liverpole)

      The line by line comparison I did shows the newline:

      ,"'!?!_`,='!?!_='w+_'=+-'w~((~_/&$/","!~/,`,=!~/,`=(+~> '=+-(~<k~_/&="
      Just do a super search for: "eintsrahgldmfopv" and you'll see it soon enough.
        That was clever, searching for "eintsrahgldmfopv" (sounds like a combination of German and Russian both -- I wonder what it might mean?).  I'll have to see whether I can work that word into another obfuscation sometime, just so I can search for it at Perlmonks.

        By the way, I notice you wrote posted your own first obfuscation not too long ago, chargrill -- welcome to the club!


        @ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://521141]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2013-05-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (519 votes), past polls