Net::FTP problem

S

soup_or_power

The following code is generating the error: can't connect (in the code
below) I'm guessing the FTP is sending the username and hostname
separated by @ instead of sending just the host name followed by user
name and password and commands. It worked fine for some time but now
quit on me. Thanks for any of your help.

sub get_ftp_handle {
my($self, $ftp_host, $ftp_user, $ftp_pwd)=@_;

my $ftp_site = $ftp_host || "storm";
my $ftp_pass = $ftp_pwd || "pqww2o4";
$ftp_user ||= "qauser";

my $ftp = Net::FTP->new($ftp_site) || do {
warn "$ftp_user\@$ftp_site: can't connect\n";
return -1;
};
$ftp->login($ftp_user, $ftp_pass) || warn "$ftp_user\@$ftp_site:
can't login\n";
$ftp->binary();
return $ftp || die("cannot open ftp connection");
}
 
S

soup_or_power

Thanks for trying to help me out. The $@ is empty. The connection is
successful but the login is reporting an error. There is no problem
with manually trying to connect to the host. The fact is this code
worked perfectly fine for some time. And it is broke all of a sudden.
Our system administrators are unable to help me because they don't
know perl.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top