in reply to Re: Non blocking read on a filehandle
in thread Non blocking read on a filehandle

> # I'm not sure the following is necessary?
> return unless vec($rfd,fileno($fh),1);

select() allows you to check for many file descriptors at once by adding each fd into the $rfd vector. The $rfd gets modified by select() to let you know which file descriptors are available.

The second line of code here verifies that the file descriptor you asked about is one that's ready.

  • Comment on Re^2: Non blocking read on a filehandle