undef $/; # That's what's in the book; local $/ may be better. $checksum = unpack("%32C*",<>) %32767;