in reply to Reading binary file byte by byte

The offset parameter refers to where you want Perl to place your data in the buffer, not the offset into the file. The docs say that it will zero pad the buffer if you specify a starting point that is different from 0 and the string has no characters in it already. See read and sysread. That is why you are seeing all those nulls.

To control the position within the file one needs to use seek, but that's only when one is going back and forth within a file. For the purposes of a simple sequential read, Perl keeps track of the position pointer all on its own and increments it after each read.

The offset parameter is normally used when you want to append data to a string or have a pipe where you want to make sure that you don't overwrite outgoing data at the front of the string with incoming data placed at the end.