I think Bob's theory 1 fits. The die is never called.
You put an alarm handler into your program which is set for 10 seconds.
I suppose the timeout for the ssh module is more like 30 seconds, so the
alarm catches first.
On Tue, Aug 27, 2002 at 01:46:20PM -0400, Chad Kellerman wrote:
>
> How do I catch the die() in an eval statement; I have been using:
>
> eval {
> alarm 10;
> $ssh->login($user);
> ($out, $error, $exit) = $ssh->cmd($cmd);
> alarm(0);
> }; # end of eval statement
> if ($@ =~ /Can't/) {
> try_again($ip, $host_name) = @_;
> }
Since you didn't install your own signal handler for ALRM the standard
handler emits a
Alarm clock
which you most likely find in "$@".
Try printing "$@" instead of matching it, and you'll see what happened.
--
Well, then let's give that Java-Wussie a beating... (me)
Michael Lamertz | +49 2234 204947 / +49 171 6900 310
Sandstr. 122 | [EMAIL PROTECTED]
50226 Frechen | http://www.lamertz.net
Germany | http://www.perl-ronin.de
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]