I have a Perl code which goes to particular website and extracts the required data from it. I face a problem if I lose my connection: the script stops functioning. How could I make the Perl script resume the connection and start the process from where the interruption took place? Can I use the Perl to resume the connection if so could any one guide me with the steps please.
Share
It is not possible to do this. Once a transport-level network (e.g. TCP/IP) connection is broken you cannot get it back again. And the HTTP protocol does not provide a higher level way of doing this.
You have to open a new HTTP connection to the server and restart your extraction. Whether you have to restart from the beginning, or can resume close to where you were when the connection broke depends on what it is you are fetching, how the website presents it, and the client-side tool you are using to do the fetching.