use POSIX ":sys_wait_h"; while ( kill(0, $pid) ) { my $addr = recv( $socket, my $time, 1024, 0 ) or select '','','',0.015; printf "\rProgress: %s", $time; my $res = waitpid($pid, WNOHANG); }