"Ted Zlatanov" <> wrote in message
news:...
> On Thu, 8 Jan 2009 10:25:54 -0000 "banzai" <> wrote:
>
> b> $ftp1->put("$FileBodyName.tar.gz") or LogError("Could not FTP copy
> $FileBodyName.tar.gz to $FTP1server");
> b> $ftp1->put("$DataTagName.gz") or LogError("Could not FTP copy
> $DataTagName.gz to $FTP1server");
>
> b> I need to modify the above so that the ftp transfers (put's) are
> attempted
> b> up to 5 times in case the remote server does not respond. No time delay
> b> needed between retries.
>
> Each one can be done like so (untested code):
>
> for (1..5)
> {
> last if $ftp1->put("$FileBodyName.tar.gz");
> LogError("Could not FTP copy $FileBodyName.tar.gz to $FTP1server");
> }
>
> In other words, do the loop 5 times unless one of the put() calls
> succeeds. If that happens, exit early with `last'.
>
> Ted
Actually, one more question
Could a smiliar 5x loop be put around the whole ftp sequence i.e. login, cwd
and put so tha the whole process is repeated 5 times if required (not just
the put) and exit early if the put succeeds