in reply to How may I know why it died?

back ticks only return STDOUT from the system call, but they do set $? to the call's error status. So at least your script can know that the call failed (and if you control res2.pl you can have it exit($errorstate) where $errorstate is specific to the cause of the problem, or even $! )
And of course, $! is often the error message (but not always)

Replies are listed 'Best First'.
RE: RE: How may I know why it died?
by Abigail (Deacon) on Jul 15, 2000 at 11:16 UTC
    You cannot rely on the $! containing anything useful if a child process has set it and died. It sometimes happens, but there's nothing that garantees this. And it's very unportable.

    And $? will contain whatever exit value the spawned program returned. This may be non-zero in the case of an error - but that is only a convention, not law. And programs can issue warnings on stderr, while completing a task succesfully.

    Just use IPC::Open3.

    -- Abigail