while(1){ $ca++; ($BlockingFlags,$InBytes,$OutBytes,$ErrorFlags) = $PortObj->status; die "lost port\n" unless defined $ErrorFlags; unless($InBytes){ last if($ca > 25); select(undef,undef,undef,0.01); next; } if($string_in = $PortObj->read($InBytes)){ # hat geklappt mach was last; } }