use strict; use IO::Socket::INET; my $trials = shift @ARGV; my $sock = IO::Socket::INET->new(PeerHost => 'localhost', PeerPort => 8080); for(1..$trials){ my $tm = time; print $sock "Hello\n"; while(my $line = <$sock>){ last if $line eq ".\n"; print $line;; } } print $sock "QUIT\n";