in reply to Re^2: Help displaying binary data bit-by-bit in binary notation
in thread Help displaying binary data bit-by-bit in binary notation
Since unpack returns a string, simply add a bit (pun intended) of split and you're done:
my $bin_str = unpack( "b*", $string ); print join( "\n", split( //, $bin_str ) );
Updated output:
unpack b = [10000110] 1 0 0 0 0 1 1 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Help displaying binary data bit-by-bit in binary notation
by ikegami (Patriarch) on Jun 15, 2006 at 03:12 UTC | |
by japhy (Canon) on Jun 15, 2006 at 03:20 UTC | |
by ikegami (Patriarch) on Jun 15, 2006 at 06:10 UTC |