Re: Net::FTP problem
- From: axel@xxxxxxxxxxxxxxxxxxxxxx
- Date: Fri, 15 Apr 2005 14:01:09 -0500
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
No. The error message is misleading. The routine attempts to make a
connexion to the $ftp_host. This fails.
> name and password and commands. It worked fine for some time but now
> quit on me. Thanks for any of your help.
This is a major clue that this function is not at fault but that
something external has changed.
Perhaps the values that are being handed to the function mean that
$ftp_host receives a invalid value which in turn sets $host_site to be
invalid.
Or maybe there have been system or network changes so that the host
is no longer reachable either through the network or by whatever name is
being used - perhaps someone removed "storm" from the /etc/aliases file
- just a wild guess.
The best thing is to try a direct FTP session from the command line to
the host and see if a connexion can be made.
> 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";
Should be:
warn "$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");
> }
Axel
.
- References:
- Net::FTP problem
- From: soup_or_power
- Net::FTP problem
- Prev by Date: Re: Net::FTP problem
- Next by Date: Re: Creating o non-existing database
- Previous by thread: Re: Net::FTP problem
- Next by thread: Finding CPU stats on Win?
- Index(es):
Relevant Pages
|