#!/usr/bin/perl use IO::Socket; use Net::Ping; $destination = '198.148.129.182'; $sock = new IO::Socket::INET (PeerAddr => '172.30.166.234', PeerPort => 9321, Proto => 'tcp', ); die "Socket could not be created. Reason: $!\n" unless $sock; print $sock "ping:$destination \n"; close ($sock);