"be consistent" | |
PerlMonks |
Looping Through FTP Addressesby he204035 (Novice) |
on Feb 27, 2012 at 07:50 UTC ( [id://956392]=perlquestion: print w/replies, xml ) | Need Help?? |
he204035 has asked for the wisdom of the Perl Monks concerning the following question: I wrote some code that will open a text file, which contains a list of servers and their ftp addresses. My code goes through the list of servers, ftp's to each, and pulls specific files, etc. The code works fine until the Net::FTP comes upon an address that is not accessible for some reason. I would like the script to carry on through the loop of each address, but once he hits that first connect timeout, he can't connect to any other addresses, even if I know they are good. Here is an example of a manual connect to a server that I can connect to manually (addresses and login info changed):
But, when run via script, this address is the 5th in the list. The 1st two are good (can connect), and then he runs into to 2 that are unreachable at the moment. So when we get to the fifth one, I would expect the script to still be able to connect, but he can't:
Here is the first part of my FTP section of my script...
If I move this address to say, 3rd in the list, instead of after the two failures, the script connects to him just fine. Sorry for the short novel...I have even tried using $ftp->quit but it comes back stating basically that you can't quit an ftp session you were never connected to.
Back to
Seekers of Perl Wisdom
|
|