in reply to Split STDIN Pipe
use File::Copy; open(PROGRAM_OUT, "| $runbin/$program.x") or die "Couldn't open '$runbin/$program.x': $!; stopped"; copy(\*STDIN, PROGRAM_OUT) or die "Couldn't copy: $!; stopped"; close(PROGRAM_OUT) or die "Error while closing: $!/$?; stopped";
Untested.
That runs your FORTRAN process, copying STDIN to it, then checks the error code on file close.Update: Actually, system() by itself should work fine... it inherits your STDIN from the main program. So if you get rid of the redirection and temporary file, it should work fine. So just
system("$runbin/$program") == 0 or die("'$runbin/$program' failed: returned signal @{[ $? >> 8 ]} +stopped";
stephen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Split STDIN Pipe
by Anonymous Monk on Apr 14, 2001 at 07:14 UTC |