in reply to select() on a client and server socket

Assuming that you have a select() in your main loop instead of a can_read() (you should if you have more than one socket), you do this ($select is an IO::Select with both your sockets):

my ($r, $w, $e) = IO::Select->select($select, $select, $select); foreach my $readable (@$r) { if ($readable == $serverSocket) { ... } elsif ($readable == $clientSocket) { ... } } # etc for $w (writable) and $e (exceptional)
If you don't care about readability/writability/exceptions on a particular socket, build separate IO::Select objects with only those sockets of interest to pass to select().