Dearest Monks,
I've been googling all morning and can't quite get the following to work as needed. I have a server that I am successfully connecting to with IO::Socket::INET. I need to connect to this server every 5 minutes and make sure that I am getting a particular string from it when I send it a particular command. The response to the command could take up to 5 minutes.
Again, the connecting to the server and the sending of the command part is working fine. I'm stuck at how to monitor the server after sending the command for 5 minutes and waiting to see if it responds with the particular string.
It needs to timeout after five minutes with an error if the string isn't received.
Here is the code so far. All it is currently doing is connecting to the server and printing out any output received.