Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     vec(EXPR,OFFSET,BITS)

             Treats a string as a vector  of  unsigned  integers,
             and  returns  the  value  of the bitfield specified.
             May also be assigned to.  BITS must be  a  power  of
             two from 1 to 32.

             Vectors created with vec() can also  be  manipulated
             with  the  logical  operators |, & and ^, which will
             assume a bit vector operation is desired  when  both
             operands  are  strings.   This interpretation is not
             enabled unless there is at least one vec()  in  your
             program, to protect older programs.

             To transform a bit vector into a string or array  of
             0's and 1's, use these:

                  $bits = unpack("b*", $vector);
                  @bits = split(//, unpack("b*", $vector));

             If you know the exact length in bits, it can be used
             in place of the *.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson