#!/s/std/bin/perl -w use strict; use IO::Socket::INET; if(@ARGV != 1) { die("usage: client.pl host:socket\n") } my $sock = new IO::Socket::INET("$ARGV[0]") or die("Couldnt connect: $!"); my $pid = fork(); if($pid == 0) { #$|++; while(<$sock>) { print $_; } } else{ while() { print $sock $_ } } close($sock);