Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Welcome to the Monastery
 
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 (Monsignor) on Jan 05, 2006 at 09:45 UTC

    Where did you find it?

    Cheers, Sören

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 having an uproarious good time at the Monastery: (11)
As of 2014-04-18 06:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (462 votes), past polls