while ($timeout % 60 == 0) { print "hier"; if(IO::Select->new($s_socket)->can_read(2)) { # 2 second timeout while (my $rc = $s_socket->recv($s_output, 1024) ) { $buffer .= $s_output; } print $buffer; $timeout = 0; # $s_socket->recv($s_output, 1024); # $timeout = 0; # print $s_output; } else { $timeout++; } print $timeout; }