I am trying to use Perl to create a simple socket client. It connects to a remote server and then sends some text then gets the server response then sends some more text etc. My problem is I can only get it to connect, send some text and show the servers reply. It won't continue to send and receive, the "Enter String to send" appears each time as per the loop but it doesn't send or recv anything to the server. Code below:
$socket = new IO::Socket::INET (
PeerAddr => '172.16.0.30',
PeerPort => 6001,
Proto => 'tcp',
or die "Couldn't connect to Server\n";
print "\nEnter a string to send to SIP: ";
As I am still a beginner I am sure this is a silly error. Can anyone spot it?