Zentara is right about what you need to do, but a fuller explanation
of the solution would have been:
Net::SFTP is throwing an exception when it cannot make the
connection. If the exception is not caught, it will cause your
program to exit. The way you catch exceptions in Perl is to wrap the
On Fri, 13 Dec 2002 11:10:54 -0500, [EMAIL PROTECTED] (Ian
Zapczynski) wrote:
Unfortunately, using the || as below doesn't change the behavior. Once
my script tries to make the connection and can't, it exists with a
connection failed to $host, etc. etc. message, whether I use warnings
or
Unfortunately, using the || as below doesn't change the behavior. Once
my script tries to make the connection and can't, it exists with a
connection failed to $host, etc. etc. message, whether I use warnings
or diagnostics or neither. If anyone can help me understand why this
may be or if
Ok, so I found that my problem appears to come from the following
portion of Net::SSH ::Perl:
connect($sock, sockaddr_in($rport, $raddr))
or die Can't connect to $ssh-{host}, port $rport: $!;
Why should it die() and not just warn()?
I found something that suggests I can intercept
All,
I just pulled down the latest Net::SFTP from CPAN and am using it w/
Perl 5.6.1. I've used the module before and don't *think* I've seen
this problem, but I can't say for sure and have only one machine to test
it on. What happens is that if an SFTP connection is refused to the
how about
#/usr/bin/perl -w
use strict;
use Net::SFTP;
my ($sftp) = Net::SFTP-new(10.25.3.150, user=administrator,
password=suite100) || warn connection failed $!;
if (!$sftp) {
print I can't connect!;
} else {
print SUCCESS!;
}
- Original Message -