Attempts to read LENGTH bytes of data into variable SCALAR from the
specified FILEHANDLE, using read(2). It bypasses
buffered IO, so mixing this with other kinds of reads,
tell, or eof can cause
confusion because the
perlio or stdio layers usually buffer data. Returns the number of
bytes actually read,
at end of file, or undef if there was an
error (in the latter case $! is also set). SCALAR will
be grown or
shrunk so that the last byte actually read is the last byte of the
scalar after the read.
An OFFSET may be specified to place the read data at some place in the
string other than the beginning. A negative OFFSET specifies
placement at that many characters counting backwards from the end of
the string. A positive OFFSET greater than the length of SCALAR
results in the string being padded to the required size with
bytes before the result of the read is appended.
Note that if the filehandle has been marked as
characters are read instead of bytes (the LENGTH, OFFSET, and the
return value of sysread
are in Unicode characters). The
open, and the open pragma.