Perl Programming/Keywords/sysread

The sysread keyword
The sysread function tries to read LENGTH number of bytes from the FILEHANDLE into the SCALAR by using read(2) of UNIX.

sysread returns the new position on success and undef otherwise. For performance reasons, even if the <tt>FILEHANDLE</tt> has been set to operate on characters, the function <tt>tell</tt> will return the byte offsets.

Do not use <tt>sysread</tt> with reads or with <tt>eof</tt>, <tt>print</tt>, <tt>seek</tt>, <tt>tell</tt>, or <tt>write</tt>, as it bypasses normal buffered I/O.

An <tt>OFFSET</tt> to place the read data this number of bytes away from start. If <tt>OFFSET</tt> is less than zero, it places the data this number of bytes before the end of the string. If <tt>OFFSET</tt> is greater than the string length, <tt>\0</tt> bytes are padded before appending the data.

If the <tt>FILEHANDLE</tt> has been marked as <tt>:utf8</tt> Unicode, characters are read instead of bytes, and the return value of <tt>sysread</tt> is in Unicode characters.