in reply to [solved] Net::FTP not catching errors, my fault?
net::ftp is probably catching the error just fine, but some other combination of your logic is returning true. Remember, FALSE or TRUE or FALSE is... true.
if ( ( $ftp->login($data->{'login'}, $data->{'pw'}) or $log->logwarn("upload_file: xqe $data->{'id'}, ", $ftp->mess +age) ) && ($ftp->binary or $log->logwarn("upload_file: xqe $data->{'id'} +, ", $ftp->message)) && ($ftp->cwd($data->{'remote_dir'}) or $log->logwarn("upload_file: xqe $data->{'id'}, ", $ftp->message)) && ($ftp->put($to_upload) or $log->logwarn("upload_file: xqe $data->{'id'}, ", $ftp->message)) && ($ftp->quit) ) { return 1; } else { $log->error("upload_file: xqe $data->{'id'}, " . "upload failed for $to_upload"); return undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::FTP not catching errors, my fault?
by ryanc (Monk) on Jun 06, 2005 at 15:10 UTC | |
by polettix (Vicar) on Jun 06, 2005 at 15:55 UTC | |
by derby (Abbot) on Jun 06, 2005 at 15:39 UTC | |
by reasonablekeith (Deacon) on Jun 06, 2005 at 16:08 UTC | |
|
Re^2: Net::FTP not catching errors, my fault?
by ryanc (Monk) on Jun 06, 2005 at 16:44 UTC |