On Tue, 3 Sep 2002, Chad Kellerman wrote:
> Hey guys,
>
> Having an issue with Net::SSH:Perl and eval.
>
> Is there another way to write this? Or am I just missing something?
>
> 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);
> my ($out, $error, $exit) = $ssh->cmd($cmd);
>
> if ($@) {
> try_again($host_ip);
> }
>
> What's happening is I get :
>
> Can't call method "login" on an undefined value at line so and so.
>
> where that line so and so is:
>
> $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.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]