in reply to Re: zero fill with pack
in thread zero fill with pack

$n & 0xffffffff won't work. You need $n % 0xffffffff.

Replies are listed 'Best First'.
Re^3: zero fill with pack
by BrowserUk (Patriarch) on Jun 22, 2010 at 16:53 UTC

    Works for my (64-bit) Perl ;)

      Yes, but that code was specifically written for "a Perl that doesn't support 64-bit ints (Q)." The bitwise ops (i.e. "&") currently require native integer arguments, and those can be at most 0xFFFFFFFF in such a Perl.