#!/user/bin/perl -w use strict; use IO::Socket::INET; sub sock_connection{ my $sockname = new IO::Socket::INET(PeerAddr => "putAddrHere", PeerPort => "Port", Proto => "tcp") or die "cannot connect to host: $!"; print $sockname "@_" # Puts data passed to sub shutdown($sockname, 1); while(<$sockname>){ # place regex to remove prompt message # Display msgs using print $_; } undef $sockname } #### sock_connection("my command here")