system call exits the loop

Discussion in 'Perl' started by Bob Helber, Jan 13, 2004.

  1. Bob Helber

    Bob Helber Guest

    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, Jan 13, 2004
    #1
    1. Advertising

  2. Bob Helber

    Bob Helber Guest

    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:
    > 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, Jan 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Franco Figún

    How many namespace exits?

    Franco Figún, Apr 26, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    2,115
    Cowboy \(Gregory A. Beamer\)
    Apr 26, 2004
  2. Anders
    Replies:
    6
    Views:
    3,380
    Anders
    Aug 5, 2005
  3. Replies:
    3
    Views:
    607
    Thomas Fritsch
    Nov 28, 2005
  4. Giampaolo Rodola'

    Call a function when a thread exits

    Giampaolo Rodola', May 8, 2009, in forum: Python
    Replies:
    2
    Views:
    267
    Giampaolo Rodola'
    May 8, 2009
  5. Isaac Won
    Replies:
    9
    Views:
    397
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page