# Fork it into two process's my $kidpid; die "Cant Fork: $!" unless defined($kidpid = fork()); if ($kidpid) { while (defined ( my $line = <$sock> ) ){ chomp($line); $line =~ s/(\x0a|\x0d)//g; # Display response from server &show($line); print "<< $line\n";