From perldoc -f select:
This calls the select(2) system call with the bit masks specified...
I bet that this tries to redirect you to the system select manpage (man 2 select), so you'll find the documentation there.
Note that whether "select" gets restarted after signals (say, SIGALRM) + is implementation-dependent.
When a signal arrive, it's likely that the select() function exits with "-1" (error), and in C you'd peruse errno to see if it's set to EINTR. I guess that in Perl a good look to $! will give you the same information.
Also, I always thought that sysread() was non-blocking, but when there is no data to read, sysread() blocks.
AFAIK, read() and similars have always been blocking, and you have to explicitly set unblocking mode to get what you want (try to see something in Fcntl and related documentation). Unluckly my mileage in Perl is quite short in these arguments, but I'd stick to select() even if i were programming in C. Given the fact that interruptions result in EINTR, you can easily restart the wait process.

Regarding the last question, I would not expect your program to bomb out if you pass a bigger buffer: it would be quite strange if such a behaviour would not be documented. The maximum (or minimum :) I can expect is that you won't get 100k of data at one time and no more, but I haven't tried it.

Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

Don't fool yourself.

In reply to Re: select() and sysread() by polettix
in thread select() and sysread() by althepal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.