Viki@Stag has asked for the wisdom of the Perl Monks concerning the following question:
Am i checking the return value of the put()/append() properly?my $ftp_obj = get_ftp_obj(); my $put_try = 0; my $cflag = 0; my $MAX_RETRIES = 5; while ($put_try < $MAX_RETRIES) { my $ret; $ret = $ftp_obj->put("$file_name") if ($put_try == 0); $ret = $ftp_obj->append("$file_name") if ($put_try > 0); last if (!$ret); # is this correct???? $put_try++; print "Retrying to append $file_name, $put_try\n"; if ($put_try == $MAX_RETRIES) { die "Not able to copy $file_name\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NET::FTP put()/append() error handling
by pc88mxer (Vicar) on Jul 02, 2008 at 05:24 UTC | |
by Viki@Stag (Sexton) on Jul 02, 2008 at 07:00 UTC | |
by Viki@Stag (Sexton) on Jul 02, 2008 at 07:06 UTC | |
by pc88mxer (Vicar) on Jul 02, 2008 at 13:43 UTC | |
by Viki@Stag (Sexton) on Jul 07, 2008 at 06:31 UTC | |
|
Re: NET::FTP put()/append() error handling
by Mr. Muskrat (Canon) on Jul 02, 2008 at 18:18 UTC |