in reply to Byte-level file inspection?

Instead of reading in the whole file and using substr(), you might want to use seek and read to read in just the part of the file you're interested in:
my $bytepos = shift || die "must supply bytepos"; my $offset = 4; my $startpos = $bytepos - $offset; $startpos = 0 if $startpos < 0; seek(F, $startpos, 0) or die "Can't seek: $!"; read(F, $chunk, $offset * 2) or die "Can't read: $!";
This will be a big win on especially large files.