in reply to Re^2: explanation for sysread and syswrite
in thread explanation for sysread and syswrite

You should re-read the docs more closely:
Returns the number of bytes actually read, 0 at end of file, or undef if there was an error (in the latter case $! is also set).
  • Comment on Re^3: explanation for sysread and syswrite