in reply to Dumping bit vector in perl

Depending upon architecture and the bitvector, 'B*' might be more useful:

main::(-e:1): 1 DB<1> x unpack 'b*', 'pqrs';; 0 00001110100011100100111011001110

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Dumping bit vector in perl
by targetsmart (Curate) on Oct 18, 2008 at 07:58 UTC
    Thanks, In the mean time I tried using, Bit::Vector::to_Bin it also works.

      You can also save yourself a lot of typing by setting it up as an alias:

      DB<5> =xb x unpack 'b*', xb = x unpack 'b*', DB<6> $_ = 'pqrs' DB<7> xb $_ 0 00001110100011100100111011001110 DB<8> $/ = '1234356577890' DB<9> xb $/ 0 1000110001001100110011000010110011001100101011000110110010101100111 +0110011101100000111001001110000001100

      Be nice if you could put a list of aliases somewhere that would cause them to be loaded each time the debugger is started. I know there is a "db profile", but I can't remember any specifics. It must be in teh docs somewhere?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.