... if ($pid == 0) { # This is the fork child while( $new_sock->connected ) { $new_sock->recv(my $data, 500); print "$data\n"; } }