Hernan Perez Masci wrote in perl.documentation : > I have noticed that the description of select perl function in perlfunc > manual > (the one that calls the select(2) syscall) doesn't mention anything about the > possibility of having -1 as a return value when an error occurs.
Just like select(2), and only if select(2) behaves that way (which is a reasonable thing to suppose). I commited the following change in bleadperl about this : ==== //depot/perl/pod/perlfunc.pod#461 (text) ==== @@ -4603,6 +4603,9 @@ is implementation-dependent. See also L<perlport> for notes on the portability of C<select>. +On error, C<select> behaves like the select(2) system call : it returns +-1 and sets C<$!>. + B<WARNING>: One should not attempt to mix buffered I/O (like C<read> or <FH>) with C<select>, except as permitted by POSIX, and even then only on POSIX systems. You have to use C<sysread> instead. > Another issue with select that I consider should be mentioned in perlfunc > manual, is that in some systems (i.e., Linux) it could return a socket file > descriptor as ready for reading, when actually no data is available, which > can be solved using always nonblocking sockets (the manual page for select(2) > shipped in debian woody is an example). Net::SNMP has this problem (i.e.: > does not use nonblocking sockets). OK. Care to submit a documentation patch appropriately formulated ? BTW patches should go to the perl5-porters mailing list, in which all discussion pertaining to the development of the core perl distribution is centralized.