kurt2439 has asked for the wisdom of the Perl Monks concerning the following question:
I'm not looping at all, I'm just trying to run another perl script from my perl script. However my process list fills up with the command stored in "$check_env_cmd". The script being called works fine on it's own. I don't get it! Here are what I think are all the relevant parts of my calling script -- it just executes the command in system() hundreds,thousands of times!
my $check_env_cmd="/usr/bin/perl /home/jchase/programming/moodle_rooms +_sync/sync_mumoodle.pl --modules --blocks"; #Make sure that a few of the critical Moodle Tests pass before loading + new db my $result=system($check_env_cmd); if ($result){ print "Environment Check Passed\n"; }else{ print "Environment Check Failed\n"; exit 1; }
I've also tried using backticks instead of the system() function. Same result. I tried inputting the command straight into system() as well but no joy. I'm sure I'm doing something stupid but I don't understand what -- it seems pretty straightforward. Is there something funny about calling a perl command from a perl command?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system($cmd) spawns infinitely
by Eliya (Vicar) on Nov 20, 2011 at 23:44 UTC | |
|
Re: system($cmd) spawns infinitely
by davido (Cardinal) on Nov 21, 2011 at 00:47 UTC | |
|
Re: system($cmd) spawns infinitely
by trizen (Hermit) on Nov 21, 2011 at 00:49 UTC | |
|
Re: system($cmd) spawns infinitely
by tospo (Hermit) on Nov 21, 2011 at 13:28 UTC | |
|
Re: system($cmd) spawns infinitely
by wol (Hermit) on Nov 25, 2011 at 10:51 UTC |