Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Ok, so I am writing a perl script (obviously), and at some point in the middle I need to run a fortran file. How do I call this within the script?

Replies are listed 'Best First'.
Re: Running fortran in perl
by pc88mxer (Vicar) on May 30, 2008 at 14:46 UTC
    If it's a separate program you can do it with system.
      Thank you! That might have seemed like an easy peasy question, but I could not find an answer anywhere except here. -No longer Anonymous Monk
Re: Running fortran in perl
by apl (Monsignor) on May 30, 2008 at 15:18 UTC
Re: Running fortran in perl
by ambrus (Abbot) on May 30, 2008 at 14:54 UTC

    Compile the fortran functions to object files with a fortran compiler, link them to a shared library, write C declarations for the publically exported functions (you may need to use some declaration modifier specific to your C compiler for this, because the calling conventions of fortran functions can be different from that of C functions), and use these C functions via XS.

    Alternately, you can use Inline::C instead of XS for some loss of flexibility.