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

Hi Monks, I have two perl programs perl1.pl and perl2.pl. perl2.pl contains an infinite loop. And i want to run the perl2.pl from perl1.pl. How can I run perl2.pl as an independent process?? Please help me.

  • Comment on Running a perl program using another perl program

Replies are listed 'Best First'.
Re: Running a perl program using another perl program
by Corion (Patriarch) on May 25, 2010 at 06:54 UTC

    See system, and potentially alarm, if your combination of operating system and Perl executable support that.

Re: Running a perl program using another perl program
by davido (Cardinal) on May 25, 2010 at 07:25 UTC

    Couldn't you fork perl1.pl, and then have the child process system (or even exec) perl2.pl? There would need to be logic built into perl1.pl that would enable the child to system perl2.pl without the parent going down the same path. If I recall, perlipc is helpful, under the section that discusses detaching the child process from its parent.

    .....just a thought. I haven't played too much with IPC myself, but it seems like a possibility.


    Dave

Re: Running a perl program using another perl program
by Anonymous Monk on May 25, 2010 at 07:07 UTC