Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

binary parsing

by biohisham (Priest)
on Jan 29, 2011 at 20:12 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found