I’m using a Perl program to properly format user input into an input file for a Fortran program. The Fortran program creates an output file and error file. The Fortran program is called from Perl like:
system "/mydirectories/fortranexecutable $inputfile $outputfile $errorfile";
I am wondering if there is a way to call the Fortran executable without actually creating the input/output/error files and saving them to the disk before/after the Fortran program is called? I hope my question is clear and not something too obvious. I’m new to Perl and I’ve tried searching everywhere for this. Thanks for your help in advance.
If the Fortran code reads sequentially from and writes sequentially to already existing files but you would like to communicate with it in “real time” from the Perl code, then you can kind of get around using named pipes. They still exist as entries in the filesystem and can be opened as usual files by the Fortran code given their name but reading/writing from/to them works like piping.
In Perl you would do something like this (blatantly copied from this answer):