in reply to Unable to 'exec'

You might find it very useful to look at Parallel::ForkManager, or any of several others in the Parallel family.   There’s a lot of “gooey glue” that has to be dealt with in all programs like this, which you have to get exactly right but that is hard to get exactly right ... and these modules will do a lot of that grunt-work for you.

Getting stuff to happen on multiple machines is a bit more complicated, but there are CPAN modules for that, too, so I am told.

Replies are listed 'Best First'.
Re^2: Unable to 'exec'
by Technext (Acolyte) on Aug 21, 2012 at 14:09 UTC
    Thanks for your reply. I couldn't test this because i had no access to system during weekend.

    I had used Parallel::ForkManager earlier (in another script). I wanted to use fork here so never went for that. Anyways, i gave it a try right now. I get the same output. :(

    Am i wrong in assuming that the result would not have changed because i anyways had to use the same exec command here too between the first and third line given below?

    my $pid = $pm->start and next; ... do some work with $data in the child process ... $pm->finish; # Terminates the child process

      Apologies! I did change my script to try the module you suggested but while running, i was calling a different script :P Sorry for that.

      It's working with the Parallel::ForkManager module! :)

      Well, i am on the lookout for modules whenever i have some issue to fix. While writing this script, i thought let's leave modules and use the basics ('fork'). Looks like it was a wrong choice for me at least for this problem. :D Anyways, thanks a lot sundialsvc4! This issue was disturbing me for quite some time now. :)