How can I sum large hexadecimal values in Perl?
问题 I'm iterating over a set of 32-bit hexadecimal strings ("DEADBEEF", "12345678", etc..) and I'm trying to sum them together to form a 32-bit checksum. Assume that the variable $temp is loaded with some hexadecimal string in the example below. my $temp; my $checksum; for (...) { #assume $temp is loaded with a new hex string here my $tempNum = hex ($temp); $checksum += $tempNum; $checksum &= 0xFFFFFFFF; print printf("checksum: %08X",$checksum); } The first few values are "7800798C", "44444444",