On Wednesday, September 4, 2002, at 04:35 , Sudarshan Raghavan wrote:
> On Tue, 3 Sep 2002, Chad Kellerman wrote:
[..]
>> my $ssh;
>> eval {
>> alarm 10;
>> $ssh = Net::SSH::Perl->new($host_ip,
>> identity_files =>["$id_key_fn"],
>> port => 22,
>> debug => $dbg);
>> alarm(0);
>> };
>> $ssh->login($user);
[..]
> The problem is $ssh is undefined. Your Net:SSH::Perl->new(...) is
> failing. Read through the module's doc to fix this.
as such he would need something right after the eval BLOCK
that would be the 'catch' semantics to the eval's "try" approach,
a la :
unless($ssh) {
#
# cope with our failure to get in....
#
}
and/or deal with the SIGALRM if the alarm(10);
is the actual reason that the new() fails????
cf: perldoc -f alarm
eg:
eval {
local $SIG{ALRM} = sub { die "alarm called in call to new ssh\n" };
alarm 10;
$ssh = Net::SSH::Perl->new($host_ip,
identity_files =>["$id_key_fn"],
port => 22,
debug => $dbg);
alarm(0);
};
die "we did not die on the alarm, and still got no \$ssh \n")
unless( $ssh );
or the appropriate alternative tricks...
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]