http://qs1969.pair.com?node_id=480098


in reply to Pack function

Which one do you get? 1010010000000000 or 00000000000000001010010000000000? If you get the big one, the one perl probably is build using 64bit or something similar!

Replies are listed 'Best First'.
Re^2: Pack function
by vrajan (Novice) on Aug 02, 2005 at 07:55 UTC
    With "n" i get 1000000000000000 in one binary and 1010010000000000 in the other.
    With "N" i get 00000000000000001010010000000000 with both binaries.
      perldoc -f pack says:
      n An unsigned short in "network" (big-endian) order.
      N An unsigned long in "network" (big-endian) order.

      IMHO it can't be endian problem!?!

      One is running on a little-endian machine and the other on a big-endian?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
        I am running the code on the same machine.