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);

    I have $user define globally. I am not too sure if this matters but
the script forks.  I don't think that is does.  But just in case.

   It's strange because this part of code works, but sometimes in one of
the childs procs I get the error.

   Anyone have any ideas?

Thanks,
Chad

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to