From: Jonathan I. Kamens Date: Thu, 3 Dec 1998 15:10:17 +0000 (-0500) Subject: sample checksum code in "perlfunc" man page is wrong X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=87843227a6d758ca7431ea6b2dc64ed0fc9796b8;p=p5sagit%2Fp5-mst-13.2.git sample checksum code in "perlfunc" man page is wrong Message-Id: <199812032010.PAA09692@jik.shore.net> p4raw-id: //depot/perl@2748 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index f9bd2c5..ef27b8b 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4322,9 +4322,9 @@ themselves. Default is a 16-bit checksum. For example, the following computes the same number as the System V sum program: while (<>) { - $checksum += unpack("%16C*", $_); + $checksum += unpack("%32C*", $_); } - $checksum %= 65536; + $checksum %= 65535; The following efficiently counts the number of set bits in a bit vector: