I've never used pack() in any useful form (shame on me) before and i'm using win2k, so this must look hideous:
H:\>perl -e "$bin='100110101111011010101110000001001100011010000110011
+101101110010000101110000001001100111011110110001101100110111010100110
+000001001000011000000100000011100100111011110110010001100011011010100
+110101101100000010010010110011101100000010000101110000101101010011000
+000100110011101000011010110110101001100101000010110110100101100111011
+000100110000001001110111000010110100101101100011000010110000001001100
+011001001110101001101000011000101110101001100010011000000100001011100
+001011010100110000001000000111001001110111101100100011000110110101001
+101011011001110100010100001011010010000010001101100100011010100110010
+011100010111000000100101000101001011001110110110011100010111010100110
+100101100111011001010000'; $l=length($bin);$a = pack \"b$l\", $s; pri
+nt $a;"
Output:
You can't solve a problem in the same
mind which created the problem.
-Albert Einstein
Edit:3 Seconds later...b*! i knew there had to be a way to stuff in all input bytes. i simultaneously saw
waswas-fng's post, and spotted that line in perldoc -f pack. ah well.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.