learningperl has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use IO::Socket; my ($line, $obj, $pid, $input); $obj = IO::Socket::INET->new(PeerAddr => "some.com", PeerPort => 7777, Proto => "tcp", Timeout => 60, ); die "cant fork" unless (defined ($pid=fork())); if ($pid) { while (defined ($line = <$obj>)) { print STDOUT $line;} kill 9, $pid; } else { while (defined ($input = <STDIN>)) { print $obj $input; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bidirectional client
by belg4mit (Prior) on Nov 25, 2001 at 07:10 UTC | |
by learningperl (Initiate) on Nov 25, 2001 at 08:17 UTC | |
by belg4mit (Prior) on Nov 25, 2001 at 09:03 UTC | |
by learningperl (Initiate) on Nov 26, 2001 at 02:58 UTC | |
by belg4mit (Prior) on Nov 26, 2001 at 07:21 UTC | |
|
IO::Select
by IlyaM (Parson) on Nov 26, 2001 at 07:34 UTC |