Communicating between perl and FORTRAN.

simX

Unofficial Mac Genius
Does anybody know of a way to transfer data between a perl program and a FORTRAN program? I have a FORTRAN subroutine that I want to call from a perl program, but I don't know exactly HOW to do that. The FORTRAN program is on a VMS machine (old, yes I know :p ).

Any help would be appreciated. I can provide more details if necessary.
 
You say, Perl on Mac and FORTRAN on VMS? Like, two different machines? I assume, remote procedure calls are completely out of the question.

Does your FORTRAN program accept data from files? Because, it seems that you will be doing that a lot. If there is an FTP server running on VMS, you can use Net::FTP from Perl to pass the data. Net::FTP needs to be installed on OS X; it is part of libnet, which you can find on your local CPAN mirror
 
Well, currently I am doing the web development on my Mac, so I was hoping there would be a way to test it.

But the website will actually be housed on a VMS machine, so it will be perl on VMS to FORTRAN on VMS.

Thanks for the heads up on that NetFTP module (I think I already installed it), but I still need some information on how exactly to call FORTRAN programs with perl -- it's going to be a web interface, so this activates a perl program which should activate a FORTRAN program which processes data, sends it back to perl (whether with a data file or other method), which then posts the results on the web. But there will need to be some communicating nonetheless, because perl needs to know when FORTRAN is done making the output file so it can read it in to process for the web.
 
well, perl should be able to kick off
a fortran program using the 'system' call
(assuming that is supported on the
VMS port of perl).

The 'system' call will 'stall' (or block)
the perl program until it is over and
then it (the perl program) continues.

Then you get perl to load the newly
created datafile.

Of course, the way you SHOULD do
it is to make a socket based client
server between the two so that
the fortran program is the server and
waiting for connection from the perl
program. Perl then shoves the data
down the pipe, fortran does what it
does and then perl receives data from
the 'server'.
 
Back
Top