#!/usr/bin/perl
use IO::Socket;
#unless  (@ARGV > 0) { die "usage: $0 host < document" }
$host=$ARGV[0];
#print "$host\n";
$remote = IO::Socket::INET->new( Proto     => "tcp",
                                 PeerAddr  => $host,
                                 PeerPort  => "(8080)",
                                );
unless ($remote) { die "cannot connect to  daemon on $host" }
$remote->autoflush(1);
sub mkfile  {
	my $line=<STDIN>;
	while ($line) {
		print  $remote "$line";
		$line=<STDIN>;
	}
#	print $remote "\n+++END+++\n";
}
mkfile;
