Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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 .

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://885066]
Approved by Corion
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2018-06-21 20:38 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (119 votes). Check out past polls.