KPeter0314 has asked for the wisdom of the Perl Monks concerning the following question:
As I am just a lowly monk, I come to the greater wisdom of the group.
I have a set of values that I would like to possibly store in a binary-style array. The data looks something like this:
Is there a way to store the values binary-style? That way the values for A, B, and C would be 11000000, 00110011, and 00001100 respectfully.Slot 0 1 2 3 4 5 6 7 Value A A B B C C B B
I would also need a method to mask the info back out of the binary storage to get my results back. e.g. (in bad pseudo-code)
if ( mask 01000000 matches arrayA )
then A is slot 1
Or, am I trying too hard?
-Kurt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Binary data type?
by tadman (Prior) on Oct 17, 2002 at 00:29 UTC | |
Re: Binary data type?
by blakem (Monsignor) on Oct 16, 2002 at 21:46 UTC | |
Re: Binary data type?
by nothingmuch (Priest) on Oct 16, 2002 at 21:55 UTC | |
Re: Binary data type?
by thor (Priest) on Oct 16, 2002 at 23:40 UTC | |
by diotalevi (Canon) on Oct 16, 2002 at 23:54 UTC | |
Re: Binary data type?
by graff (Chancellor) on Oct 17, 2002 at 05:45 UTC | |
by KPeter0314 (Deacon) on Oct 17, 2002 at 15:44 UTC |
Back to
Seekers of Perl Wisdom