#!/usr/local/bin/perl -w #use strict; use IO::Socket; #my ($socket, $child_pid, $line) = (); $socket = IO::Socket::INET->new ( PeerAddr => '123.123.123.123', # changed ip for post =) PeerPort => '5123', Proto => "tcp", Type => SOCK_STREAM ) or die "Could not create client: $!\n"; unless (defined($child_pid = fork())) {die "Can not fork: $!\n"}; if ($child_pid) { while ($line = <>) { print $socket $line; } } else { while ($line = <$socket>) { print "SERVER: $line"; } }