Section B.11. Bits and Pieces


B.11. Bits and Pieces

You can work with an array of bits (a bitstring) with the vec operator, setting bit number 123, clearing bit number 456, and checking the state of bit 789. Bitstrings may be of arbitrary size. The vec operator can work with chunks of other sizes as long as the size is a small power of two, so it's useful if you need to view a string as a compact array of nybbles. See the perlfunc manpage.



Learning Perl
Learning Perl, 5th Edition
ISBN: 0596520107
EAN: 2147483647
Year: 2003
Pages: 232

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net