For example, the following computes the same number as the System V sum program: $checksum = do { local $/; # slurp! unpack("%32C*",<>) % 65535; };