Re: Net::FTP problem
- From: Christian Winter <thepoet_nospam@xxxxxxxx>
- Date: Fri, 15 Apr 2005 20:59:25 +0200
soup_or_power@xxxxxxxxx wrote:
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.
Net::FTP will never send user:pass@host, because this is just a way some clients allow the data to be entered. However, your code doesn't even reach the login line.
It worked fine for some time but now quit on me. Thanks for any of your help.
So something must have been changed. Did you alter your script in some other parts? If no, has the server been altered (ip changed, ftp daemon stopped)? Has someone changed the firewall you are behind (if there is one)? Does your
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; };
From the perldoc of Net::FTP's constructor: ------------------------------------------------------------ If the constructor fails undef will be returned and an error message will be in $@. ------------------------------------------------------------
So make the code above
my $ftp = Net::FTP->new($ftp_site) or do {
warn "Unable to connect to $ftp_site. Error is: $@\n";
return -1;
};
to find out why the connection failed.HTH -Chris .
- Follow-Ups:
- Re: Net::FTP problem
- From: soup_or_power
- Re: Net::FTP problem
- References:
- Net::FTP problem
- From: soup_or_power
- Net::FTP problem
- Prev by Date: Creating a non-existing database through Perl
- Next by Date: Re: Net::FTP problem
- Previous by thread: Net::FTP problem
- Next by thread: Re: Net::FTP problem
- Index(es):
Relevant Pages
|