Re: [Ssh-sftp-perl-users] errors :(
Brought to you by:
dbrobins
|
From: Mark F. <mar...@ea...> - 2004-11-24 00:15:48
|
> I now get the "permission denied" and a complete exit of the program when
the
> user/pass pairs are wrong. I'd like to change this to just have it give me
> some kind of error code.
I think you need to surround your method call within an eval block and catch
the die. I posted something to this list last February about how I worked
around this. It involves eval and capturing SIG{__WARN__}. It seemed like
multiple warnings could occur before a die. So, catching that signal let me
accumulate them before the die. The example I posted uses "do_realpath." I
don't think it actually dies. But, some other things like connecting and
logging in do. I got in the habit of wrapping everything this way.
See:
http://sourceforge.net/mailarchive/message.php?msg_id=7114680
Seth, I'll post the Expect.pm example later.
Mark
|