in reply to Difference between Perl and Java for << operator?

Tested on my 64 bit machine:
use strict; use warnings; my $HIGH_BITS = 0xFFFFFFFF << 28; printf "%X\n", $HIGH_BITS; # prints: FFFFFFFF0000000 # each hex digit is 4 bits, 7 zeroes x4 = 28 bits left shifted
Usually displaying something like that in decimal would be nonsensical.

If you have an "all ones" in a 32 bit register, and you shift the contents 28 bits to the left, the high nibble will be "F". This will result in a negative value as viewed as a 2's complement number.

Update: jwkrahn came up with the ball on this one:
The trick is how to get Perl to display this value as signed integer.
On Windows the quoting is a bit different, But this works on my Windows machine.

>perl -le "my $HIGH_BITS = unpack "l", pack "l", 0xFFFFFFFF << 28; pri +nt $HIGH_BITS; " -268435456
A simple: print $HIGH_BITS on my machine yields: 1152921504338411520 which of course is not right. This looks like the unsigned decimal value.