#!/usr/bin/perl -w

use IO::Socket;
if (@ARGV != 2) { die "usage: $0 host port" }
$host = shift(@ARGV);
$port = shift(@ARGV);

$EOL = "\015\012";

# socket & connect
$remote = IO::Socket::INET->new( Proto     => "tcp",
								 PeerAddr  => $host,
								 PeerPort  => $port ,
							   );
unless ($remote) { die "cannot connect to http daemon on $host" }
$remote->autoflush(1);

print $remote "5" . $EOL;

$rivi = <$remote>;
print $rivi;

close $remote;

