my $select=new IO::Select(); $select->add($socket); if ($select->can_read($timeout)