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

Hi everybody, I am writing a script that glues various programs together, one of which is a some Fortran code that falls over unless 'limit stacksize unlimited' is entered before running. Is there a way I can do this from my script? I optimistically tried using system, but with no success. Thanks in advance. (I am using Linux)

Replies are listed 'Best First'.
Re: limit stacksize unlimited
by JavaFan (Canon) on Aug 08, 2008 at 09:57 UTC
    I will assume you are running a UNIX or UNIX like system. You can increase the stacksize limit on a per process bases (limits will be inherited by child processes). So calling ulimit in a system just by its own will set the limit for the spawned process, which then terminates.

    What you probably want is:

    system "ulimit -s unlimited; your_fortan_program";
    That will start a shell, in the shell you increase the stack size limit, and then the shell calls the Fortran program, which will inherit the setting.

    Or you could increase the stack size limit before you call your Perl program.

Re: limit stacksize unlimited
by dHarry (Abbot) on Aug 08, 2008 at 09:48 UTC
Re: limit stacksize unlimited
by Anonymous Monk on Aug 08, 2008 at 09:37 UTC
    What is 'limit stacksize unlimited'?

    Just guessing, but maybe you want

    system 'limit stacksize unlimited && fortran blah blah blah'