my $bin_str = unpack( "b*", $string ); print join( "\n", split( //, $bin_str ) ); #### unpack b = [10000110] 1 0 0 0 0 1 1 0