#!/usr/local/bin/perl
# tcp line echo client
# terminates when "CLOSE\n" is sent
# Peter Walsh csci 460

use IO::Socket;
$sock = new IO::Socket::INET (
                              PeerAddr => 'cscicad.mala.bc.ca',
                              PeerPort => '7071',
                              Proto => 'tcp',
                             );
die "Could not create socket: $!\n" unless $sock;
print "Enter text to be sent to server followed by crlf\n";
print "Enter CLOSE followed by crlf to close connections\n";
$line=<>;
while ($line ne "CLOSE\n") {
   print $sock $line;
   $line=<>;
}
close($sock);


