A google for that error suggests that the cause is: "The DNS is not properly configured on the workstation or there are problems with the DNS server".
Whether that will help him track down his problem I don't know, but it tends to strongly indicate that it is a problem local to his configuration or network rather than anything that you can fix in the script.
It's also hard to see how the snippet you posted would be causing a DNS lookup? How sure are you that it is that part of the code that is failing?
In reply to Re: IO::Socket::INET fails in rare cases on Windows
by BrowserUk
in thread IO::Socket::INET fails in rare cases on Windows
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |