$record=<INDX> is alias for
readline, which is buffered ( AFAIK at least when
$/ is a newline). As others rightly noted, mixing buffered and non-buffered I/O is not a good idea. It is also not clear also whether your
$/ is a newline or 41, - in the latter case it simply can be a perl bug, and all the best practices with locating and reporting it do apply.
Also, you said that you've converted code into using sysread, but I can't think about how sysread($f, $buf, 41) would slurp anything beyond the 41th byte. I'd however use buffered I/O here, but the same question
goes to read($f, $buf, 41) as well.