Is there anything wrong the script bewlow, because I just can’t login…..
And I’m sure I’m using the right username and password.
(Cannot login Login incorrect.)
sub UploadToFTPServer()
{
my $filename = shift;
$ftp = Net::FTP->new($FTPSERVER, Debug => 0) ;
if ($ftp) {
eval {
$ftp->login($USERNAME,$PASSWORD) or warn "Cannot login ", $ftp->message;
$ftp->binary();
$ftp->putfile($filename) or warn "Cannot upload ($filename)", $ftp->message;
$ftp->quit();
};
}
else {
warn "Cannot connect to $FTPSERVER: $@";
}
}
Start your script off with this:
Then make sure that perl doesn’t try to interpolate anything in your un/pw.
Given your error, it should work with those changes. It would have been easier to catch if the strict and warnings pragmas were used from the start.