Book HomeLearning Perl, 3rd EditionSearch this book

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 to see the state of bit 789. Bitstrings may be of arbitrary size. The vec operator can also 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, say. See the perlfunc manpage.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.