#Create Socket socket(Impact, PF_INET, SOCK_STREAM, getprotobyname('tcp')); #Build the address of connection my $internet_addr = inet_aton("axtcnr") or die "Couldn't convert axtimpact into internet address\n"; my $paddr = sockaddr_in(6540, $internet_addr); #Connect connect(Impact,$paddr)or die "Couldn't connect to axtimpact:6540 \n"; select ((select(Impact) , $| = 1)[0]); #enable command buffering if($msg =~ m{(\013.*\034\015)}smx){ print Impact $1; } shutdown(Impact,1); #read the remote answer my $server_message = do { local $/; }; # get the response print "recieved: $server_message\n"; #Terminate the connection when done close(Impact);