Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on


I'm confused about code sample from here:

How do I manipulate arrays of bits?

They say:

...given a vector in $vec , you can get those bits into your @ints array:

and give following code as "fast general algorithm"


What are they trying to do with two lines starting with push operators? Don't they want to get a list "e.g. ( 1, 0, 0, 1, 1, 0 ... )" as stated in the beginning of that section, i.e. do reverse conversion? They can't do it with this code, do they?

In reply to Confusion about code sample in perlfaq4 by vr

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (12)
    As of 2014-12-27 16:31 GMT
    Find Nodes?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?

      Results (177 votes), past polls