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?


In reply to system($cmd) spawns infinitely by kurt2439

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.