in reply to Why is pack("N",42949672965) giving me 00 00 00 05

Arg! Sure sign of too many hours on the keyboard... Fellow monks, thank you very much everyone!
  • Comment on Re: Why is pack("N",42949672965) giving me 00 00 00 05

Replies are listed 'Best First'.
Re^2: Why is pack("N",42949672965) giving me 00 00 00 05
by ikegami (Patriarch) on Feb 09, 2015 at 02:38 UTC
    You know you can use 0xFFFFFFFF, right?

      ... or even 0xFFFF_FFFF or 4_294_967_295 for that matter.


      Give a man a fish:  <%-(-(-(-<

        Why not simply use -1?

        $ perl -MDP -we'DHexDump pack ("N", -1)' 0000 ff ff ff ff .... $ perl -MDP -we'DHexDump pack ("Q", -1)' 0000 ff ff ff ff ff ff ff ff ........

        Enjoy, Have FUN! H.Merijn
        @AnomalousMonk: well, didn't know that. but never liked the underscore notation for numbers, anyway... :)
      @ ikegami: yes, knew that.
        It was a rhetorical question. The implication is that you should have used 0xFFFF_FFFF. If you had, you wouldn't have made the error you did.