in reply to Perl Net::FTP put() gives little help on errors
You are not checking for errors.
This code is untested
use strict; use warnings; use Net::FTP; my $ftp = Net::FTP->new($server, Timeout=>1800, Passive=>1, Debug=>3) +or die "[Error] UNABLE TO CREATE FTP OBJECT: [$@]"; if ($ftp->login($user, $pswd)) { $ftp->cwd("files"); $ftp->binary(); if (! $ftp->put("build.zip")) { my $ftp_message = $ftp->message; chomp($ftp_message); print "[Error] UNABLE TO PUT FILE - [$ftp_message]\n"; } } else { my $ftp_message = $ftp->message; chomp($ftp_message); die "[Error] UNABLE TO LOGIN TO FTP [$server] USING LOGIN ACCOUNT: +[$user]-[$ftp_message]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Net::FTP put() gives little help on errors
by amitsk (Initiate) on Jan 07, 2010 at 10:05 UTC | |
by cdarke (Prior) on Jan 07, 2010 at 10:40 UTC |