December 2000
Intermediate to advanced
784 pages
20h 54m
English
As soon as you use nonblocking filehandles, things become a bit more complex because of the several possible outcomes of calling sysread() and syswrite().
When you use sysread() with a nonblocking filehandle, the following outcomes are possible:
If you request N bytes of data and at least N are available, then sysread() fills the scalar buffer you provide with N bytes and returns the number of bytes read.
If you request N bytes of data and fewer bytes are available (but at least 1), then sysread() fills the scalar buffer with the available bytes and returns the number read.
If you request N bytes of data and no bytes are available, then sysread() returns undef and sets $! to EWOULDBLOCK ...
Read now
Unlock full access