system call exits the loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Helber

    system call exits the loop

    I've got a perl script with a system command, within a for loop, that
    calls a FORTRAN program. For one of the iterations of the for loop the
    FORTRAN program quits with an error due to bad input. This then exits
    the for loop and does not continue the loop, which I would like it to
    do, even if the FORTRAN program crashes. How can I "catch" this error
    and continue the loop. Do I have to fix the FORTRAN program to exit
    more cleanly?

    Thanks for any help.

  • Bob Helber

    #2
    Re: system call exits the loop

    Disregard this post, the system call fail does not exit the for loop.
    My bad. I was also hung up on the fact that system outputs a 0 for a
    failed process.

    Bob Helber wrote:[color=blue]
    > I've got a perl script with a system command, within a for loop, that
    > calls a FORTRAN program. For one of the iterations of the for loop the
    > FORTRAN program quits with an error due to bad input. This then exits
    > the for loop and does not continue the loop, which I would like it to
    > do, even if the FORTRAN program crashes. How can I "catch" this error
    > and continue the loop. Do I have to fix the FORTRAN program to exit
    > more cleanly?
    >
    > Thanks for any help.
    >[/color]

    Comment

    Working...