Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

binary parsing

by biohisham (Priest)
on Jan 29, 2011 at 20:12 UTC ( #885066=obfuscated: print w/ replies, xml ) Need Help??

My very humble first attempt at obfuscation.... Hope this can be an initiator for me into deeper unbeaten paths...
print join(' ',map{unpack("A", pack("B8",$_)),''} qw( 01010000 01100101 01110010 01101100 00001010 01001101 01101111 01101110 01101011 01110011 00001010 01010010 01101111 01100011 01101011 01110011 00001010 ));



Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

Comment on binary parsing
Select or Download Code
Re: binary parsing
by ikegami (Pope) on Jan 29, 2011 at 21:16 UTC
    This is surprising
    $ perl -le'print length unpack "A", "\n";' 0

    But documented.

      It seems that the output is different on an Win32 XP system...
      perl -le"print length unpack "A", "\n";" 1
      Could you please direct me in which side of the documentation neighborhood that this is reported ?



      Excellence is an Endeavor of Persistence. A Year-Old Monk :D .

        Your quoting is broken. You are doing

        >perl -le"print length unpack 'A', \'n';" 1

        which is the same as

        >perl -le"print length unpack 'A', 'S';" 1

        If you fix the quoting, you get the correct result.

        >perl -le"print length unpack 'A', qq{\n};" 0

        pack says "When unpacking, «A» strips trailing whitespace and nulls".

Re: binary parsing
by sblanton (Sexton) on Apr 14, 2011 at 12:50 UTC
    I like this for its aesthetic beauty. You could have written everything on one line, but you have a nicely formatted pattern to mesmerize and contemplate.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2014-07-28 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (200 votes), past polls