in reply to Occasional Read Timeout with Mech

One possibility is that it has nothing to do with Perl but instead once in a while the connection to the server never gets established for whatever reason. Have you tried doing the same thing your script is doing with a program like wget to see if you have the same problem there? Connections not getting established can actually be somewhat normal depending on where the server is in relation to the client (i.e. are you going over an Internet connection or is it on a local network?). You can also try to capture a failed connection with Wireshark to get a better idea if this problem is at the network level.

Replies are listed 'Best First'.
Re^2: Occasional Read Timeout with Mech
by Anonymous Monk on Dec 17, 2014 at 11:56 UTC
    Update: ... never gets established or gets interrupted for whatever reason. (Really, a lot of things can go wrong on a network connection depending on how far away the server is...)
Re^2: Occasional Read Timeout with Mech
by pirkil (Beadle) on Dec 17, 2014 at 12:23 UTC
    Actually, I have tried wget before WWW::Mechanize (I couldn't figure out correct settings for Mech initialization first) and it has worked. The connection is over internet. I am afraid taht the problem it is related with the host. I will probably increase time of sleep & timeout, as suggested by Discipulus. Thx for your answer.