#!/usr/local/bin/perl -w use strict; use IO::Socket; my $host = shift || 'localhost'; my $port = shift || 5194; my $fh = IO::Socket::INET->new("$host:$port") or die "connect: $!"; print "Perl client calling $host $port\n"; while () { print $fh $_; my $reply = <$fh>; chomp $reply; print "got [$reply]\n"; last if ($reply =~ /exit/); } close($fh);