$p = 7; $n = $p ^ 0xFFFF_FFFF; # im on 32-bit winxp system printf "%x", $n; # FFFFFFF8