in reply to String eval is cool

or without eval...
$mask = 0xffffffff - 2**(32 - $bits) + 1;