in reply to Problems with IO::Select

Try printing $! after the call to can_read. select should set it.

Speaking of error checking,
$client->{socket} = IO::Socket::UNIX->new(...);
should be
$client->{socket} = IO::Socket::UNIX->new(...)
   or die("Unable to open socket: $!\n");

Replies are listed 'Best First'.
Re^2: Problems with IO::Select
by dirtdart (Beadle) on Jul 02, 2006 at 18:43 UTC
    Thanks for the info. Putting print $! directly after the while statement produced nothing, so I added an END block to the code and put print $! in it. The only thing printed was "Interrupted System Call" which still leaves me not knowing what the heck is going on with it, but hopefully tells one of you gurus what I'm doing wrong.

      That message is from something that happened between the while and the END — possibly something internal — not something from the select.

      That $! is blank seems to indicate the select succeeded (for some definition of succeeded), or $r wasn't defined.

      I personally don't know anything about *unix* sockets. Maybe they are different from IP sockets in some important manner for select. I don't think I'll be of any more use to you.