#!/usr/bin/perl -w use strict; use IO::Socket; my $host = shift || die "No host"; my $port = 7890; my $action = shift || die "No action"; my $ip = shift || die "No ip"; my $sock = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp') or die "Can't Bind :$@!\n\n"; print $sock "$action "; print $sock "$ip\n"; while( <$sock> ) { print $_; } close $sock;