in reply to Continue Processing Subrouting Until Successfull
I think this is what you're wanting:
foreach (@host) { my $result = 255; while( $result == 255 ) { $result = run($_); } mail(); } sub run { my $host = $_[0]; my $user = 'root'; my $host = 'test-1'; my $cmd = '/usr/local/scripts/down.pl'; return( ssh("$user\@$host", $cmd) ); }
According to OpenSSH's documentation it returns 255 if there is an error. This should loop until you get success.
-----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Continue Processing Subrouting Until Successfull
by Dru (Hermit) on Jan 08, 2003 at 16:18 UTC | |
by ides (Deacon) on Jan 08, 2003 at 17:59 UTC | |
by osama (Scribe) on Jan 09, 2003 at 22:36 UTC |