Re: Net::SSH::Perl sending output to STDOUT
ryanmhuc_at_yahoo.com
Date: 02/09/05
- Next message: Rhugga: "Re: The Problem with Perl"
- Previous message: Rhugga: "Easy Method to 'slurp' a line toeknized by split"
- In reply to: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Next in thread: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Reply: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Feb 2005 10:06:29 -0800
Martin,
I think theres a misunderstanding here. The code i am using is in the
first post. And its not like the method $ssh->login is kicking back an
error here if the pass is wrong it is exiting my program and printing
"Permission denied" to the STDOUT. Of course its not going to login if
the pass is wrong but why in the world is it halting my program?
after executing:
$ssh->login($user || $this_user, $pass);
the program dies and prints
"Permission denied at test.pl line 43"
I don't want my program to exit at this statment if the password is
incorrect. How do I do that? How do I trap it? Perhaps this is the
behavior of the module but what good is it if you can't error trap if
the password is incorrect.
Martin Kissner wrote:
> ryanmhuc@yahoo.com wrote :
> > Thanks for the script but it does the same thing.
>
> What same thing?
>
> > If the password
is
> > incorrect for the login i get:
> > "Permission denied at test.pl line 43"
> > and then it stops the program.
>
> What do you expect? If the pw is incorrect you should't be able to
log
> in, should you?
>
> > The issue is I need to catch this.
The
> > script I'm trying to create logins into about 16 different servers.
> > These servers passwords are not supposed to change but every once
in a
> > while one does. I want the program to not die when it can't login
to
> > the server but instead trap it, let me know and then continue with
the
> > script.
>
> Then you should probably check for success.
> if (your command) {
> do stuff;
> }
> else {
> do other stuff;
> }
>
> btw:
> You'd probably increase your chances of getting qualified help by
> avoiding TOFU quoting an providing some code example.
>
> HTH
> Martin
>
> [ TOFU snipped ]
>
> --
> perl -e 'print
7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
> .32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
- Next message: Rhugga: "Re: The Problem with Perl"
- Previous message: Rhugga: "Easy Method to 'slurp' a line toeknized by split"
- In reply to: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Next in thread: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Reply: Martin Kissner: "Re: Net::SSH::Perl sending output to STDOUT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|