in reply to Re: Re: Continue Processing Subrouting Until Successfull
in thread Continue Processing Subrouting Until Successfull

No, the result is 255 until a success. So you want to continue looping until $result is not 255.

As for the $result = run($_); If you notice I added a return() into the run subroutine. This will return the exit code of the ssh() call, which will be 255 ( according to OpenSSH's documentation ) if there is an error or the exit code of the command being run if there isn't an error.

If your down.pl script returns a different exit code you'll want to adust your test to not be 255.

-----------------------------------
Frank Wiles <frank@wiles.org>
http://frank.wiles.org
  • Comment on Re: Re: Re: Continue Processing Subrouting Until Successfull