on Fri, 07 Jun 2002 23:28:44 GMT, Eric Abell wrote:

> My question is this: what is the difference between "c" and "C"? I
> know what perldoc says - one is a signed char and the other is an
> unsigned char. So if I have the value 230, shouldn't that be illegal
> for a signed 8-bit number, since the valid range is -127 to 128. I
> tried every value between 0 and 255 and there is no difference
> between "c" and "C". 

You will see the difference in unpack:

    my $p = pack("C", 230);

    print unpack("C", $p), "\n"; # prints 230
    print unpack("c", $p), "\n"; # prints -26

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to