sub sb2d{ my $b = unpack 'N', pack("B32", substr("0" x 32 . shift, -32)); $b > 2**31 ? -(1+~$b) : $b }