in reply to Flipping bits and using flags
This assumes that bit 6 is at pos 5 since $pos is really an offset (0 based). You can also use pack and unpack [bB] format to convert back and forth between strings like '01100111' and bitstrings.print vec($bitstr, $pos, 1) ? 'on' : 'off';
While what my reply has little to nothing to do with what you are doing with MySQL and sets, I didn't want others to be scared of bitstrings just because they sound scary. They can be quite simple.
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Flipping bits and using flags
by BMaximus (Chaplain) on Mar 23, 2006 at 21:58 UTC |