Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • select ($rbits, undef, $ebits, TIMEOUT);

    The first 3 arguments to select are value/return - on input you give a bitmask of the file descriptors you are interested in, on output only the bits corresponding "interesting" file descriptors are set. So it's likely that after the first call to select, all the bits were zeroed, and so for subsequent calls the arguments you passed in say that you're not interested in any file descriptors, so you never call any of your action functions. The solution is something like

    select ($rout = $rbits, undef, $eout = $ebits, TIMEOUT);
    so that $rbits and $ebits are never modified, with the action tests on $rout and $eout
    • I know, and if you look at the code, it's setting $ebits and $rbits in each iteration. $BITS is set once, and it's not modified. Just before the select loop, $ebits and $rbits are initialized with $BITS.
      • Ah OK. So I was right when I had this hunch on hitting "Submit" that I'd missed something. :-)