in reply to Re^2: how to pack bits, flags and masks
in thread how to pack bits, flags and masks
$setbits = unpack "%32b*", $selectmask;
should be:
$setbits = unpack "%32b*", $packedmask;
so:
$setbits = unpack('%32b*', pack('N', $selectmask));
does the trick
print(unpack("%32b*", pack('N', 0x00500011)), $/); # 4
|
|---|